aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/uvc/uvc_v4l2.c
diff options
context:
space:
mode:
authorMartin Rubli <martin_rubli@logitech.com>2010-09-08 03:15:23 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-20 23:18:22 -0400
commit8fb91b33c6bfa3ac5e4ad76920b7bcd7bdbbb6d0 (patch)
treec7e33ca829580a6a8d8f8808c4b860cf12a2cbca /drivers/media/video/uvc/uvc_v4l2.c
parentba2fa99668bb9bf03757a020f15bba295d5c0a3e (diff)
[media] uvcvideo: Remove sysadmin requirements for UVCIOC_CTRL_MAP
This patch removes the sysadmin requirements for UVCIOC_CTRL_MAP (and the stub implementation of UVCIOC_CTRL_ADD). This requirement no longer makes sense with the new XU control access mechanisms since XU controls can be accessed without adding control mappings first. A maximum number (currently 1024) of control mappings per device is enforced to avoid excess memory consumption caused by careless user space applications. Signed-off-by: Martin Rubli <martin_rubli@logitech.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/uvc/uvc_v4l2.c')
-rw-r--r--drivers/media/video/uvc/uvc_v4l2.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/media/video/uvc/uvc_v4l2.c b/drivers/media/video/uvc/uvc_v4l2.c
index 4a510483f7c5..6d15de9b5204 100644
--- a/drivers/media/video/uvc/uvc_v4l2.c
+++ b/drivers/media/video/uvc/uvc_v4l2.c
@@ -1025,16 +1025,10 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
1025 /* Dynamic controls. */ 1025 /* Dynamic controls. */
1026 case UVCIOC_CTRL_ADD: 1026 case UVCIOC_CTRL_ADD:
1027 /* Legacy ioctl, kept for API compatibility reasons */ 1027 /* Legacy ioctl, kept for API compatibility reasons */
1028 if (!capable(CAP_SYS_ADMIN))
1029 return -EPERM;
1030
1031 return -EEXIST; 1028 return -EEXIST;
1032 1029
1033 case UVCIOC_CTRL_MAP_OLD: 1030 case UVCIOC_CTRL_MAP_OLD:
1034 case UVCIOC_CTRL_MAP: 1031 case UVCIOC_CTRL_MAP:
1035 if (!capable(CAP_SYS_ADMIN))
1036 return -EPERM;
1037
1038 return uvc_ioctl_ctrl_map(chain, arg, 1032 return uvc_ioctl_ctrl_map(chain, arg,
1039 cmd == UVCIOC_CTRL_MAP_OLD); 1033 cmd == UVCIOC_CTRL_MAP_OLD);
1040 1034