diff options
author | Martin Hostettler <martin@neutronstar.dyndns.org> | 2011-09-19 01:04:56 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-09-23 22:07:56 -0400 |
commit | 69967a71ae6ebe7aace94ef15f269b8bf2b5ce1e (patch) | |
tree | f1432a2f1191cee7c15b70505eb0b9849b516db2 /drivers/media/video/v4l2-subdev.c | |
parent | eb39a303d5561dd7d07af9052f6dd596dfdcf275 (diff) |
[media] v4l subdev: add dispatching for VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER
Ioctls on the subdevs node currently don't dispatch the register access debug
driver callbacks. Add the dispatching with the same security checks are for
non subdev video nodes (i.e. only capable(CAP_SYS_ADMIN may call the register
access ioctls).
Signed-off-by: Martin Hostettler <martin@neutronstar.dyndns.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/v4l2-subdev.c')
-rw-r--r-- | drivers/media/video/v4l2-subdev.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/media/video/v4l2-subdev.c b/drivers/media/video/v4l2-subdev.c index b7967c9dc4ae..179e20e23fc4 100644 --- a/drivers/media/video/v4l2-subdev.c +++ b/drivers/media/video/v4l2-subdev.c | |||
@@ -173,6 +173,25 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg) | |||
173 | 173 | ||
174 | case VIDIOC_UNSUBSCRIBE_EVENT: | 174 | case VIDIOC_UNSUBSCRIBE_EVENT: |
175 | return v4l2_subdev_call(sd, core, unsubscribe_event, vfh, arg); | 175 | return v4l2_subdev_call(sd, core, unsubscribe_event, vfh, arg); |
176 | |||
177 | #ifdef CONFIG_VIDEO_ADV_DEBUG | ||
178 | case VIDIOC_DBG_G_REGISTER: | ||
179 | { | ||
180 | struct v4l2_dbg_register *p = arg; | ||
181 | |||
182 | if (!capable(CAP_SYS_ADMIN)) | ||
183 | return -EPERM; | ||
184 | return v4l2_subdev_call(sd, core, g_register, p); | ||
185 | } | ||
186 | case VIDIOC_DBG_S_REGISTER: | ||
187 | { | ||
188 | struct v4l2_dbg_register *p = arg; | ||
189 | |||
190 | if (!capable(CAP_SYS_ADMIN)) | ||
191 | return -EPERM; | ||
192 | return v4l2_subdev_call(sd, core, s_register, p); | ||
193 | } | ||
194 | #endif | ||
176 | #if defined(CONFIG_VIDEO_V4L2_SUBDEV_API) | 195 | #if defined(CONFIG_VIDEO_V4L2_SUBDEV_API) |
177 | case VIDIOC_SUBDEV_G_FMT: { | 196 | case VIDIOC_SUBDEV_G_FMT: { |
178 | struct v4l2_subdev_format *format = arg; | 197 | struct v4l2_subdev_format *format = arg; |