V4L/DVB (7547): em28xx: Fix a broken lock
authorMauro Carvalho Chehab <mchehab@infradead.org>
Sun, 13 Apr 2008 17:55:38 +0000 (14:55 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Thu, 24 Apr 2008 17:08:10 +0000 (14:08 -0300)
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/em28xx/em28xx-video.c

index c559352..033ecb4 100644 (file)
@@ -790,15 +790,12 @@ static int res_get(struct em28xx_fh *fh)
        if (fh->stream_on)
                return rc;
 
-       mutex_lock(&dev->lock);
-
        if (dev->stream_on)
-               rc = -EINVAL;
-       else {
-               dev->stream_on = 1;
-               fh->stream_on  = 1;
-       }
+               return -EINVAL;
 
+       mutex_lock(&dev->lock);
+       dev->stream_on = 1;
+       fh->stream_on  = 1;
        mutex_unlock(&dev->lock);
        return rc;
 }