staging: bcm2835-camera: Add sanity checks for queue_setup/CREATE_BUFS
authorDave Stevenson <dave.stevenson@raspberrypi.org>
Sat, 29 Jun 2019 19:31:41 +0000 (21:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Jul 2019 07:10:19 +0000 (09:10 +0200)
commit1029e7a71e51ebd6bd01f973b427c95634401f15
treef0809bc21f04409eca80d315ec38b002f0bf8c10
parenteb3539767a358129c20e536774eb1fa67b46ac27
staging: bcm2835-camera: Add sanity checks for queue_setup/CREATE_BUFS

Fixes a v4l2-compliance failure when passed a buffer that is
too small.
queue_setup wasn't handling the case where *nplanes != 0, as
used from CREATE_BUFS and requiring the driver to sanity
check the provided buffer parameters. It was assuming that
it was always being used in the REQBUFS case where it provides
the buffer properties.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c