Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5db0b5e1 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

V4L/DVB (9930): em28xx: Fix bad locks on error condition

parent 02ebf23b
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -819,8 +819,10 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
	vidioc_try_fmt_vid_cap(file, priv, f);
	vidioc_try_fmt_vid_cap(file, priv, f);


	fmt = format_by_fourcc(f->fmt.pix.pixelformat);
	fmt = format_by_fourcc(f->fmt.pix.pixelformat);
	if (!fmt)
	if (!fmt) {
		return -EINVAL;
		rc = -EINVAL;
		goto out;
	}


	if (videobuf_queue_is_busy(&fh->vb_vidq)) {
	if (videobuf_queue_is_busy(&fh->vb_vidq)) {
		em28xx_errdev("%s queue busy\n", __func__);
		em28xx_errdev("%s queue busy\n", __func__);
@@ -1305,9 +1307,7 @@ static int vidioc_streamon(struct file *file, void *priv,
	mutex_lock(&dev->lock);
	mutex_lock(&dev->lock);
	rc = res_get(fh);
	rc = res_get(fh);


	if (unlikely(rc < 0))
	if (likely(rc >= 0))
		return rc;

		rc = videobuf_streamon(&fh->vb_vidq);
		rc = videobuf_streamon(&fh->vb_vidq);


	mutex_unlock(&dev->lock);
	mutex_unlock(&dev->lock);