]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerSasha Levin <alexander.levin@microsoft.com>
Wed, 23 May 2018 01:33:46 +0000 (21:33 -0400)
commit3b73d7fbca260f6552337fec58aa2e11ab4ff3ea
tree306e2bd776e5aaeb3569d26bfb8a03e7ab76047f
parent2e0aa7ccd22aaf71c0763d1ce3d48dc847eaf645
media: cpia2: Fix a couple off by one bugs

[ Upstream commit d5ac225c7d64c9c3ef821239edc035634e594ec9 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
drivers/media/usb/cpia2/cpia2_v4l.c