aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l2-ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/v4l2-ioctl.c')
-rw-r--r--drivers/media/video/v4l2-ioctl.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c
index 7e47f15f350d..f51327ef6757 100644
--- a/drivers/media/video/v4l2-ioctl.c
+++ b/drivers/media/video/v4l2-ioctl.c
@@ -1659,20 +1659,24 @@ static long __video_do_ioctl(struct file *file,
1659 { 1659 {
1660 struct v4l2_dbg_register *p = arg; 1660 struct v4l2_dbg_register *p = arg;
1661 1661
1662 if (!capable(CAP_SYS_ADMIN)) 1662 if (ops->vidioc_g_register) {
1663 ret = -EPERM; 1663 if (!capable(CAP_SYS_ADMIN))
1664 else if (ops->vidioc_g_register) 1664 ret = -EPERM;
1665 ret = ops->vidioc_g_register(file, fh, p); 1665 else
1666 ret = ops->vidioc_g_register(file, fh, p);
1667 }
1666 break; 1668 break;
1667 } 1669 }
1668 case VIDIOC_DBG_S_REGISTER: 1670 case VIDIOC_DBG_S_REGISTER:
1669 { 1671 {
1670 struct v4l2_dbg_register *p = arg; 1672 struct v4l2_dbg_register *p = arg;
1671 1673
1672 if (!capable(CAP_SYS_ADMIN)) 1674 if (ops->vidioc_s_register) {
1673 ret = -EPERM; 1675 if (!capable(CAP_SYS_ADMIN))
1674 else if (ops->vidioc_s_register) 1676 ret = -EPERM;
1675 ret = ops->vidioc_s_register(file, fh, p); 1677 else
1678 ret = ops->vidioc_s_register(file, fh, p);
1679 }
1676 break; 1680 break;
1677 } 1681 }
1678#endif 1682#endif