]> git.baikalelectronics.ru Git - kernel.git/commit
media: v4l2-dev/ioctl: require non-zero device_caps, verify sane querycap results
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Tue, 23 Jul 2019 08:21:25 +0000 (04:21 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 25 Jul 2019 10:28:51 +0000 (06:28 -0400)
commit3ec9ce05962a48ec3850023131d457c04cada8d0
tree883ab470dc8d470ef7e4c71432b33baca748a46f
parentd3193acaa803a063f558802b023cc6388a0de526
media: v4l2-dev/ioctl: require non-zero device_caps, verify sane querycap results

Now that all V4L2 drivers set device_caps in struct video_device, we can add
a check for this to ensure all future drivers fill this in.

Also verify that when the querycap ioctl is called the driver didn't mess
with the device_caps value and that capabilities is a superset of device_caps.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
[hverkuil-cisco@xs4all.nl: fix too-long line]
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/v4l2-core/v4l2-dev.c
drivers/media/v4l2-core/v4l2-ioctl.c