]> git.baikalelectronics.ru Git - kernel.git/commit
media: cpia2: Fix a couple off by one bugs
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 9 Nov 2017 21:28:14 +0000 (16:28 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 8 Dec 2017 16:12:53 +0000 (11:12 -0500)
commit8112680f973c08a4bab7a0e2e7dd66ff57762bc1
tree5e69609632fcc8148ab1c114566757ebf9ef8c0b
parent6b9b345a50e4976ccc0cafb76a4c7942e9e19d43
media: cpia2: Fix a couple off by one bugs

The cam->buffers[] array has cam->num_frames elements so the > needs to
be changed to >= to avoid going beyond the end of the array.  The
->buffers[] array is allocated in cpia2_allocate_buffers() if you want
to confirm.

Fixes: c2ceda9c30a3 ("V4L/DVB (3376): Add cpia2 camera support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/usb/cpia2/cpia2_v4l.c