]> git.baikalelectronics.ru Git - kernel.git/commit
media: v4l: ioctl: Validate num_planes for debug messages
authorSakari Ailus <sakari.ailus@linux.intel.com>
Thu, 10 Jan 2019 14:24:26 +0000 (09:24 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 16 Jan 2019 16:12:38 +0000 (11:12 -0500)
commit599d4d8700a92dcc3bb44669c2633d2062a3e597
treef244e1df17f4af3b6c486e08294f696c14eae3a4
parentacf0ff15c3349e36794c70a4dc9e2d9f2049ea38
media: v4l: ioctl: Validate num_planes for debug messages

The num_planes field in struct v4l2_pix_format_mplane is used in a loop
before validating it. As the use is printing a debug message in this case,
just cap the value to the maximum allowed.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: stable@vger.kernel.org
Reviewed-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: <stable@vger.kernel.org> # for v4.12 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/v4l2-core/v4l2-ioctl.c