aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2008-12-22 04:14:31 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-30 06:39:21 -0500
commit5db0b5e1adff92dac54f2dfb1846a42501c8f7d9 (patch)
tree35269dd4a5274febc8c90a9a667deb284161d635 /drivers/media/video/em28xx
parent02ebf23bc20eee5d91d008a9e831e7768d963946 (diff)
V4L/DVB (9930): em28xx: Fix bad locks on error condition
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx')
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index dbae8bcb18d7..fc41eead640b 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -819,8 +819,10 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
819 vidioc_try_fmt_vid_cap(file, priv, f); 819 vidioc_try_fmt_vid_cap(file, priv, f);
820 820
821 fmt = format_by_fourcc(f->fmt.pix.pixelformat); 821 fmt = format_by_fourcc(f->fmt.pix.pixelformat);
822 if (!fmt) 822 if (!fmt) {
823 return -EINVAL; 823 rc = -EINVAL;
824 goto out;
825 }
824 826
825 if (videobuf_queue_is_busy(&fh->vb_vidq)) { 827 if (videobuf_queue_is_busy(&fh->vb_vidq)) {
826 em28xx_errdev("%s queue busy\n", __func__); 828 em28xx_errdev("%s queue busy\n", __func__);
@@ -1305,10 +1307,8 @@ static int vidioc_streamon(struct file *file, void *priv,
1305 mutex_lock(&dev->lock); 1307 mutex_lock(&dev->lock);
1306 rc = res_get(fh); 1308 rc = res_get(fh);
1307 1309
1308 if (unlikely(rc < 0)) 1310 if (likely(rc >= 0))
1309 return rc; 1311 rc = videobuf_streamon(&fh->vb_vidq);
1310
1311 rc = videobuf_streamon(&fh->vb_vidq);
1312 1312
1313 mutex_unlock(&dev->lock); 1313 mutex_unlock(&dev->lock);
1314 1314