Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Ricardo Ribalda and committed by
Mauro Carvalho Chehab
bdee6bdb 20e5d580

+1 -1
+1 -1
drivers/media/usb/em28xx/em28xx-video.c
··· 1664 1664 1665 1665 em28xx_videodbg("users=%d\n", dev->users); 1666 1666 1667 - mutex_lock(&dev->lock); 1668 1667 vb2_fop_release(filp); 1668 + mutex_lock(&dev->lock); 1669 1669 1670 1670 if (dev->users == 1) { 1671 1671 /* the device is already disconnect,