diff options
author | Hans de Goede <j.w.r.degoede@hhs.nl> | 2008-09-03 16:12:14 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-09-03 17:37:28 -0400 |
commit | 0f523c2ff6b5ab3b4412cf56dee77ac57be24103 (patch) | |
tree | 81898036d7d8a845e190257b2e2f02d48e74315a /drivers/media | |
parent | f50ba1bed3cfd65d6899afc4cb77299ee5c297ae (diff) |
V4L/DVB (8815): gspca: Fix problems with disabled controls.
Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/gspca/gspca.c | 6 |
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); |