[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:
Ricardo Ribalda 2013-11-06 05:39:35 -03:00 committed by Mauro Carvalho Chehab
parent 0e0fe3958f
commit 98c24dcd63
1 changed files with 1 additions and 1 deletions

View File

@ -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,