[PATCH 3.12 113/123] [media] usbvision: fix locking error

From: Jiri Slaby
Date: Wed Oct 28 2015 - 09:58:46 EST


From: Hans Verkuil <hans.verkuil@xxxxxxxxx>

3.12-stable review patch. If anyone has any objections, please let me know.

===============

commit e2c84ccb0fbe5e524d15bb09c042a6ca634adaed upstream.

If remove_pending is non-zero, then the v4l2_lock is never unlocked.

Signed-off-by: Hans Verkuil <hans.verkuil@xxxxxxxxx>
Signed-off-by: Mauro Carvalho Chehab <mchehab@xxxxxxxxxxxxxxx>
Cc: Oliver Neukum <ONeukum@xxxxxxxx>
Signed-off-by: Jiri Slaby <jslaby@xxxxxxx>
---
drivers/media/usb/usbvision/usbvision-video.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/usbvision/usbvision-video.c b/drivers/media/usb/usbvision/usbvision-video.c
index 661f7f2a9e8b..ea5ec8ed67a7 100644
--- a/drivers/media/usb/usbvision/usbvision-video.c
+++ b/drivers/media/usb/usbvision/usbvision-video.c
@@ -435,6 +435,7 @@ static int usbvision_v4l2_close(struct file *file)
usbvision_scratch_free(usbvision);

usbvision->user--;
+ mutex_unlock(&usbvision->v4l2_lock);

if (power_on_at_open) {
/* power off in a little while
@@ -448,7 +449,6 @@ static int usbvision_v4l2_close(struct file *file)
usbvision_release(usbvision);
return 0;
}
- mutex_unlock(&usbvision->v4l2_lock);

PDEBUG(DBG_IO, "success");
return 0;
--
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/