summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/em28xx/em28xx-video.c
diff options
context:
space:
mode:
authorRicardo Ribalda <ricardo.ribalda@gmail.com>2013-11-06 05:39:35 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2013-11-29 14:45:19 -0200
commit98c24dcd6392784b1cd0dca462abe6f91f0cadc9 (patch)
treeacb38647fafef77a61f8ec1a51e8600d38da41c1 /drivers/media/usb/em28xx/em28xx-video.c
parent0e0fe3958fdd13dbf55c3a787acafde6efd04272 (diff)
downloadop-kernel-dev-98c24dcd6392784b1cd0dca462abe6f91f0cadc9.zip
op-kernel-dev-98c24dcd6392784b1cd0dca462abe6f91f0cadc9.tar.gz
[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/em28xx/em28xx-video.c')
-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 fc5d60e..dd19c9f 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,
OpenPOWER on IntegriCloud