提交 43322faf 编写于 作者: P Pali Rohár 提交者: Jiri Kosina

radio-bcm2048.c: fix wrong overflow check

This patch fixes an off by one check in bcm2048_set_region().
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NPali Rohár <pali.rohar@gmail.com>
Signed-off-by: NPavel Machek <pavel@ucw.cz>
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册