From: Ricardo Ribalda Date: Wed, 6 Nov 2013 08:39:35 +0000 (-0300) Subject: [media] em28xx-video: Swap release order to avoid lock nesting X-Git-Tag: next-20131202~44^2^2~3 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=98c24dcd6392784b1cd0dca462abe6f91f0cadc9;p=karo-tx-linux.git [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 Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- 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,