Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);