media: vb2: check for sane values from queue_setup
authorJohan Fjeldtvedt <johfjeld@cisco.com>
Mon, 17 Sep 2018 08:36:47 +0000 (04:36 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 24 Sep 2018 13:28:41 +0000 (09:28 -0400)
commit8ee92410e5bf29b7a2fcaf53ca241554c4bae7a9
tree5540b6dddc37942a9b6da8e5d1c0714e6ec545b3
parent58513d48494d4153cc1df81aa7dfb0ec844731f8
media: vb2: check for sane values from queue_setup

Warn and return error from the reqbufs ioctl when driver sets 0 number
of planes or 0 as plane sizes, as these values don't make any sense.
Checking this here stops obviously wrong values from propagating
further and causing various problems that are hard to trace back to
either of these values being 0.

Signed-off-by: Johan Fjeldtvedt <johfjeld@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/common/videobuf2/videobuf2-core.c