mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 21:07:02 +09:00
media: radio-bcm2048: fix wrong overflow check
commit 5d60122b7e 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
4a579221c8
commit
8def99cd33
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user