Skip to content

Commit 6706fe5

Browse files
Dan Carpentermchehab
authored andcommitted
media: dvb_ca_en50221: off by one in dvb_ca_en50221_io_do_ioctl()
The > should be >= so we don't read one element beyond the end of the ca->slot_info[] array. The array is allocated in dvb_ca_en50221_init(). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Jasmin Jessich <jasmin@anw.at> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
1 parent 320905b commit 6706fe5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/media/dvb-core/dvb_ca_en50221.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1391,7 +1391,7 @@ static int dvb_ca_en50221_io_do_ioctl(struct file *file,
13911391
struct dvb_ca_slot *sl;
13921392

13931393
slot = info->num;
1394-
if ((slot > ca->slot_count) || (slot < 0)) {
1394+
if ((slot >= ca->slot_count) || (slot < 0)) {
13951395
err = -EINVAL;
13961396
goto out_unlock;
13971397
}

0 commit comments

Comments
 (0)