Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

[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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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,