[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>
This commit is contained in:
parent
20e5d58019
commit
bdee6bdb67
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue