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

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
Mauro Carvalho Chehab 2008-04-13 14:55:38 -03:00
parent f245e549f0
commit e74153d44a

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