diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-22 10:14:31 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-30 12:39:21 +0100 |
commit | 5db0b5e1adff92dac54f2dfb1846a42501c8f7d9 (patch) | |
tree | 35269dd4a5274febc8c90a9a667deb284161d635 | |
parent | V4L/DVB (9928): Convert GP8PSK module to use S2API (diff) | |
download | linux-5db0b5e1adff92dac54f2dfb1846a42501c8f7d9.tar.xz linux-5db0b5e1adff92dac54f2dfb1846a42501c8f7d9.zip |
V4L/DVB (9930): em28xx: Fix bad locks on error condition
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/em28xx/em28xx-video.c | 12 |
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, vidioc_try_fmt_vid_cap(file, priv, f); fmt = format_by_fourcc(f->fmt.pix.pixelformat); - if (!fmt) - return -EINVAL; + if (!fmt) { + rc = -EINVAL; + goto out; + } if (videobuf_queue_is_busy(&fh->vb_vidq)) { em28xx_errdev("%s queue busy\n", __func__); @@ -1305,10 +1307,8 @@ static int vidioc_streamon(struct file *file, void *priv, mutex_lock(&dev->lock); rc = res_get(fh); - if (unlikely(rc < 0)) - return rc; - - rc = videobuf_streamon(&fh->vb_vidq); + if (likely(rc >= 0)) + rc = videobuf_streamon(&fh->vb_vidq); mutex_unlock(&dev->lock); |