summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorRicardo Ribalda <ricardo.ribalda@gmail.com>2013-11-06 09:39:35 +0100
committerMauro Carvalho Chehab <m.chehab@samsung.com>2013-11-29 17:45:19 +0100
commit98c24dcd6392784b1cd0dca462abe6f91f0cadc9 (patch)
treeacb38647fafef77a61f8ec1a51e8600d38da41c1 /drivers/media/usb
parent[media] usbtv: Add support for PAL video source (diff)
downloadlinux-98c24dcd6392784b1cd0dca462abe6f91f0cadc9.tar.xz
linux-98c24dcd6392784b1cd0dca462abe6f91f0cadc9.zip
[media] em28xx-video: Swap release order to avoid lock nesting
vb2_fop_release might take the video queue mutex lock. In order to avoid nesting mutexes the private mutex is taken after the fop_release has finished. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/em28xx/em28xx-video.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
index fc5d60efd4ab..dd19c9ff76e0 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
@@ -1664,8 +1664,8 @@ static int em28xx_v4l2_close(struct file *filp)
em28xx_videodbg("users=%d\n", dev->users);
- mutex_lock(&dev->lock);
vb2_fop_release(filp);
+ mutex_lock(&dev->lock);
if (dev->users == 1) {
/* the device is already disconnect,