[media] usbvision: fix locking error
authorInsu Yun <wuninsu@gmail.com>
Mon, 1 Feb 2016 15:59:30 +0000 (13:59 -0200)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 2 Feb 2016 16:28:56 +0000 (14:28 -0200)
When remove_pending is non-zero, v4l2_lock is never unlocked.

Signed-off-by: Insu Yun <wuninsu@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/usb/usbvision/usbvision-video.c

index 7f5d6f15a49f85de19785c6eb53154d9e137599d..12f5ebbd0436e770022e7501a80f5dda7849f9a1 100644 (file)
@@ -1147,6 +1147,7 @@ static int usbvision_radio_close(struct file *file)
        usbvision_audio_off(usbvision);
        usbvision->radio = 0;
        usbvision->user--;
+       mutex_unlock(&usbvision->v4l2_lock);
 
        if (usbvision->remove_pending) {
                printk(KERN_INFO "%s: Final disconnect\n", __func__);
@@ -1155,7 +1156,6 @@ static int usbvision_radio_close(struct file *file)
                return 0;
        }
 
-       mutex_unlock(&usbvision->v4l2_lock);
        PDEBUG(DBG_IO, "success");
        return v4l2_fh_release(file);
 }