radio-bcm2048.c: fix wrong overflow check

This patch fixes an off by one check in bcm2048_set_region().

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
Pali Rohár 2014-04-22 15:57:26 +03:00 committed by Jiri Kosina
parent 15a0b3fba4
commit 43322faf5f
1 changed files with 1 additions and 1 deletions

View File

@ -737,7 +737,7 @@ static int bcm2048_set_region(struct bcm2048_device *bdev, u8 region)
int err;
u32 new_frequency = 0;
if (region > ARRAY_SIZE(region_configs))
if (region >= ARRAY_SIZE(region_configs))
return -EINVAL;
mutex_lock(&bdev->mutex);