From: Mauro Carvalho Chehab Date: Sun, 13 Apr 2008 17:55:38 +0000 (-0300) Subject: V4L/DVB (7547): em28xx: Fix a broken lock X-Git-Tag: v2.6.26-rc1~1084^2~167 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=e74153d44a57d9445fb1dfad7c3accbec6d4a873;p=linux-2.6-omap-h63xx.git V4L/DVB (7547): em28xx: Fix a broken lock Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index c5593526a6e..033ecb45256 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/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; }