Commit bdee6bdb authored by Ricardo Ribalda's avatar Ricardo Ribalda Committed by Mauro Carvalho Chehab

[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: default avatarRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 20e5d580
...@@ -1664,8 +1664,8 @@ static int em28xx_v4l2_close(struct file *filp) ...@@ -1664,8 +1664,8 @@ static int em28xx_v4l2_close(struct file *filp)
em28xx_videodbg("users=%d\n", dev->users); em28xx_videodbg("users=%d\n", dev->users);
mutex_lock(&dev->lock);
vb2_fop_release(filp); vb2_fop_release(filp);
mutex_lock(&dev->lock);
if (dev->users == 1) { if (dev->users == 1) {
/* the device is already disconnect, /* the device is already disconnect,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment