Commit 43322faf authored by Pali Rohár's avatar Pali Rohár Committed by Jiri Kosina

radio-bcm2048.c: 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 avatarJiri Kosina <jkosina@suse.cz>
parent 15a0b3fb
...@@ -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