Commit 5d60122b authored by Pali Rohár's avatar Pali Rohár Committed by Mauro Carvalho Chehab

[media] radio-bcm2048: fix wrong overflow check

This patch fixes an off by one check in bcm2048_set_region().
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarPali Rohár <pali.rohar@gmail.com>
Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 9f6be2bc
...@@ -737,7 +737,7 @@ static int bcm2048_set_region(struct bcm2048_device *bdev, u8 region) ...@@ -737,7 +737,7 @@ static int bcm2048_set_region(struct bcm2048_device *bdev, u8 region)
int err; int err;
u32 new_frequency = 0; u32 new_frequency = 0;
if (region > ARRAY_SIZE(region_configs)) if (region >= ARRAY_SIZE(region_configs))
return -EINVAL; return -EINVAL;
mutex_lock(&bdev->mutex); mutex_lock(&bdev->mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment