summaryrefslogtreecommitdiff
path: root/drivers/media/dvb-core
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-07-04 05:48:35 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-08-02 14:21:39 -0400
commit6706fe55af6fc2bcb069a77620ae38662bf09d1c (patch)
tree4690722c20a18b4a5b8e4c36fcaea1f872a890c7 /drivers/media/dvb-core
parent320905baa1dbddd3991c287432176d536e1d5b79 (diff)
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>
Diffstat (limited to 'drivers/media/dvb-core')
-rw-r--r--drivers/media/dvb-core/dvb_ca_en50221.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c
index 1310526b0d49..4d371cea0d5d 100644
--- a/drivers/media/dvb-core/dvb_ca_en50221.c
+++ b/drivers/media/dvb-core/dvb_ca_en50221.c
@@ -1391,7 +1391,7 @@ static int dvb_ca_en50221_io_do_ioctl(struct file *file,
struct dvb_ca_slot *sl;
slot = info->num;
- if ((slot > ca->slot_count) || (slot < 0)) {
+ if ((slot >= ca->slot_count) || (slot < 0)) {
err = -EINVAL;
goto out_unlock;
}