Browse Source

V4L/DVB (7547): em28xx: Fix a broken lock

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Mauro Carvalho Chehab 17 years ago
parent
commit
e74153d44a
1 changed files with 4 additions and 7 deletions
  1. 4 7
      drivers/media/video/em28xx/em28xx-video.c

+ 4 - 7
drivers/media/video/em28xx/em28xx-video.c

@@ -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;
 }