diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2014-04-22 15:57:26 +0300 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2014-05-05 15:34:08 +0200 |
commit | 43322faf5fc35df218c942742a577d5abe3eaac8 (patch) | |
tree | 96a56c44721e40ee7b33c4ba3a1e82db396a6d84 /drivers/staging/media | |
parent | 15a0b3fba4e6770a3a6ce488b8de1350cc6a4bed (diff) |
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>
Diffstat (limited to 'drivers/staging/media')
-rw-r--r-- | drivers/staging/media/bcm2048/radio-bcm2048.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.c index b2cd3a85166d..bbf236e842a9 100644 --- a/drivers/staging/media/bcm2048/radio-bcm2048.c +++ b/drivers/staging/media/bcm2048/radio-bcm2048.c @@ -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); |