V4L/DVB (8605): gspca: Fix of gspca_zc3xx oops - 2.6.27-rc1
authorRabin Vincent <rabin@rab.in>
Sun, 3 Aug 2008 10:58:54 +0000 (07:58 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Wed, 6 Aug 2008 09:57:27 +0000 (06:57 -0300)
Bad mini/max check in setting control values (the gamma in
zc3xx could be set to null).

Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/gspca/gspca.c

index 7f773e3789793edb076fead8ae755bb48f5cabef..15d302b28b795d7d5e727a1e1091964dbb1e651f 100644 (file)
@@ -904,7 +904,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
                if (ctrl->id != ctrls->qctrl.id)
                        continue;
                if (ctrl->value < ctrls->qctrl.minimum
-                   && ctrl->value > ctrls->qctrl.maximum)
+                   || ctrl->value > ctrls->qctrl.maximum)
                        return -ERANGE;
                PDEBUG(D_CONF, "set ctrl [%08x] = %d", ctrl->id, ctrl->value);
                if (mutex_lock_interruptible(&gspca_dev->usb_lock))