aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/gspca/gspca.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index 33161e1e0bcc..e7e73ec7134c 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -869,7 +869,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
869 id &= V4L2_CTRL_ID_MASK; 869 id &= V4L2_CTRL_ID_MASK;
870 id++; 870 id++;
871 for (i = 0; i < gspca_dev->sd_desc->nctrls; i++) { 871 for (i = 0; i < gspca_dev->sd_desc->nctrls; i++) {
872 if (id < gspca_dev->sd_desc->ctrls[i].qctrl.id) 872 if (gspca_dev->sd_desc->ctrls[i].qctrl.id < id)
873 continue; 873 continue;
874 if (ix < 0) { 874 if (ix < 0) {
875 ix = i; 875 ix = i;
@@ -908,6 +908,8 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
908 i++, ctrls++) { 908 i++, ctrls++) {
909 if (ctrl->id != ctrls->qctrl.id) 909 if (ctrl->id != ctrls->qctrl.id)
910 continue; 910 continue;
911 if (gspca_dev->ctrl_dis & (1 << i))
912 return -EINVAL;
911 if (ctrl->value < ctrls->qctrl.minimum 913 if (ctrl->value < ctrls->qctrl.minimum
912 || ctrl->value > ctrls->qctrl.maximum) 914 || ctrl->value > ctrls->qctrl.maximum)
913 return -ERANGE; 915 return -ERANGE;
@@ -934,6 +936,8 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
934 i++, ctrls++) { 936 i++, ctrls++) {
935 if (ctrl->id != ctrls->qctrl.id) 937 if (ctrl->id != ctrls->qctrl.id)
936 continue; 938 continue;
939 if (gspca_dev->ctrl_dis & (1 << i))
940 return -EINVAL;
937 if (mutex_lock_interruptible(&gspca_dev->usb_lock)) 941 if (mutex_lock_interruptible(&gspca_dev->usb_lock))
938 return -ERESTARTSYS; 942 return -ERESTARTSYS;
939 ret = ctrls->get(gspca_dev, &ctrl->value); 943 ret = ctrls->get(gspca_dev, &ctrl->value);