All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: linux-media@vger.kernel.org
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Subject: [PATCH 09/12] usbvision: fix locking error
Date: Mon, 20 Jul 2015 14:59:35 +0200	[thread overview]
Message-ID: <1437397178-5013-10-git-send-email-hverkuil@xs4all.nl> (raw)
In-Reply-To: <1437397178-5013-1-git-send-email-hverkuil@xs4all.nl>

From: Hans Verkuil <hans.verkuil@cisco.com>

If remove_pending is non-zero, then the v4l2_lock is never unlocked.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/usb/usbvision/usbvision-video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/usbvision/usbvision-video.c b/drivers/media/usb/usbvision/usbvision-video.c
index 4f425f3..a5e82c0 100644
--- a/drivers/media/usb/usbvision/usbvision-video.c
+++ b/drivers/media/usb/usbvision/usbvision-video.c
@@ -426,13 +426,13 @@ static int usbvision_v4l2_close(struct file *file)
 	usbvision_scratch_free(usbvision);
 
 	usbvision->user--;
+	mutex_unlock(&usbvision->v4l2_lock);
 
 	if (usbvision->remove_pending) {
 		printk(KERN_INFO "%s: Final disconnect\n", __func__);
 		usbvision_release(usbvision);
 		return 0;
 	}
-	mutex_unlock(&usbvision->v4l2_lock);
 
 	PDEBUG(DBG_IO, "success");
 	return v4l2_fh_release(file);
-- 
2.1.4


  parent reply	other threads:[~2015-07-20 13:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-20 12:59 [PATCH 00/12] usbvision: convert to control framework Hans Verkuil
2015-07-20 12:59 ` [PATCH 01/12] [media] coda: make NV12 format default Hans Verkuil
2015-07-20 12:59 ` [PATCH 02/12] usbvision: remove power_on_at_open and timed power off Hans Verkuil
2015-07-20 12:59 ` [PATCH 03/12] usbvision: convert to the control framework Hans Verkuil
2015-07-20 12:59 ` [PATCH 04/12] usbvision: return valid error in usbvision_register_video() Hans Verkuil
2015-07-20 12:59 ` [PATCH 05/12] usbvision: remove g/s_audio and for radio remove enum/g/s_input Hans Verkuil
2015-07-20 12:59 ` [PATCH 06/12] usbvision: the radio device node has wrong caps Hans Verkuil
2015-07-20 12:59 ` [PATCH 07/12] usbvision: frequency fixes Hans Verkuil
2015-07-20 12:59 ` [PATCH 08/12] usbvision: set field and colorspace Hans Verkuil
2015-07-20 12:59 ` Hans Verkuil [this message]
2015-07-20 12:59 ` [PATCH 10/12] usbvision: fix DMA from stack warnings Hans Verkuil
2015-07-20 12:59 ` [PATCH 11/12] usbvision: fix standards for S-Video/Composite inputs Hans Verkuil
2015-07-20 12:59 ` [PATCH 12/12] usbvision: move init code to probe() Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437397178-5013-10-git-send-email-hverkuil@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=hans.verkuil@cisco.com \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.