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)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 31 May 2018 23:30:04 +0000 (00:30 +0100)
commit8a95224d7ef3818fb367acc4a6cbdfb30229a8a7
tree9662b58257134c412e92791ec4ae1fdb5eb7ed6b
parent03e58a520044e3ea80a3ea43586f956e2e86c74d
media: cpia2: Fix a couple off by one bugs

commit d5ac225c7d64c9c3ef821239edc035634e594ec9 upstream.

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: ab33d5071de7 ("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>
[bwh: Backported to 3.2: adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/media/video/cpia2/cpia2_v4l.c