summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/em28xx
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2008-12-22 07:14:31 -0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-22 07:14:31 -0200
commita47d14089127cf096b56de570d96ac0d2611f679 (patch)
tree243cfbbd280c75691b5f83e836e577f8b0763f25 /linux/drivers/media/video/em28xx
parent45232ac0864b8ed7b275e20303a8175d18b1f3d4 (diff)
downloadmediapointer-dvb-s2-a47d14089127cf096b56de570d96ac0d2611f679.tar.gz
mediapointer-dvb-s2-a47d14089127cf096b56de570d96ac0d2611f679.tar.bz2
em28xx: Fix bad locks on error condition
From: Mauro Carvalho Chehab <mchehab@redhat.com> Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/em28xx')
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-video.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-video.c b/linux/drivers/media/video/em28xx/em28xx-video.c
index 9fb9363dc..de4065bd7 100644
--- a/linux/drivers/media/video/em28xx/em28xx-video.c
+++ b/linux/drivers/media/video/em28xx/em28xx-video.c
@@ -825,8 +825,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__);
@@ -1317,10 +1319,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);