]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (9875): gspca - main: Fix vidioc_s_jpegcomp locking.
authorJim Paris <jim@jtan.com>
Wed, 10 Dec 2008 08:50:44 +0000 (05:50 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 16 Dec 2008 18:43:58 +0000 (16:43 -0200)
Signed-off-by: Jim Paris <jim@jtan.com>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/gspca/gspca.c

index 748a87e82e4423e2b9ecfb4c4ac621a339231e4a..02a6e9ef033740d7401b6bd1ccd5966552add823 100644 (file)
@@ -1264,10 +1264,10 @@ static int vidioc_s_jpegcomp(struct file *file, void *priv,
        struct gspca_dev *gspca_dev = priv;
        int ret;
 
-       if (mutex_lock_interruptible(&gspca_dev->usb_lock))
-               return -ERESTARTSYS;
        if (!gspca_dev->sd_desc->set_jcomp)
                return -EINVAL;
+       if (mutex_lock_interruptible(&gspca_dev->usb_lock))
+               return -ERESTARTSYS;
        ret = gspca_dev->sd_desc->set_jcomp(gspca_dev, jpegcomp);
        mutex_unlock(&gspca_dev->usb_lock);
        return ret;