Skip to content

Commit

Permalink
V4L/DVB (9930): em28xx: Fix bad locks on error condition
Browse files Browse the repository at this point in the history
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Mauro Carvalho Chehab committed Dec 30, 2008
1 parent 02ebf23 commit 5db0b5e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/media/video/em28xx/em28xx-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -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__);
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 5db0b5e

Please sign in to comment.