]> err.no Git - linux-2.6/commitdiff
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 c5593526a6e724b467bb1ca2b5b46d44017bbf46..033ecb45256b9a24d162d2bfa9ef440a58dcb37c 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;
 }