Skip to content

Commit

Permalink
V4L/DVB (7547): em28xx: Fix a broken lock
Browse files Browse the repository at this point in the history
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Mauro Carvalho Chehab committed Apr 24, 2008
1 parent f245e54 commit e74153d
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions drivers/media/video/em28xx/em28xx-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e74153d

Please sign in to comment.