summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/em28xx/em28xx-video.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-13 11:55:38 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-13 11:55:38 -0300
commitb86b4b8178e1138396086c4a21abe9a2e0695860 (patch)
treead0b1f5a74020d45d8c6f4fb98fdfbe7048c4294 /linux/drivers/media/video/em28xx/em28xx-video.c
parente0c1e01aabf66d47f4903f4b6d439258faa880af (diff)
downloadmediapointer-dvb-s2-b86b4b8178e1138396086c4a21abe9a2e0695860.tar.gz
mediapointer-dvb-s2-b86b4b8178e1138396086c4a21abe9a2e0695860.tar.bz2
em28xx: Fix a broken lock
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/em28xx/em28xx-video.c')
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-video.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-video.c b/linux/drivers/media/video/em28xx/em28xx-video.c
index 9ebb43742..d40f72096 100644
--- a/linux/drivers/media/video/em28xx/em28xx-video.c
+++ b/linux/drivers/media/video/em28xx/em28xx-video.c
@@ -831,15 +831,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;
}