summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2014-04-22 12:02:39 -0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-06-30 20:13:58 -0700
commit8def99cd33c20db5bc9296c1d55ed96c2e12f9ae (patch)
tree29287b0de35790d70bf0d2f2403820a29eff0395 /drivers
parent4a579221c86dc35646e5c314804c876524a20675 (diff)
media: radio-bcm2048: fix wrong overflow check
commit 5d60122b7e30f275593df93b39a76d3c2663cfc2 upstream. 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: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/media/bcm2048/radio-bcm2048.c2
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);