Skip to content

Commit

Permalink
[media] em28xx-video: Swap release order to avoid lock nesting
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ricardo Ribalda authored and Mauro Carvalho Chehab committed Dec 9, 2013
1 parent 20e5d58 commit bdee6bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/usb/em28xx/em28xx-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit bdee6bd

Please sign in to comment.