V4L/DVB (4865): Fix: Slot 0 not NULL on disconnecting SN9C10x PC Camera
authorLuca Risolia <luca.risolia@studio.unibo.it>
Tue, 21 Nov 2006 11:13:59 +0000 (08:13 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Sun, 26 Nov 2006 10:52:37 +0000 (08:52 -0200)
The patch fix bug 5748.

Signed-off-by: Luca Risolia <luca.risolia@studio.unibo.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/et61x251/et61x251_core.c
drivers/media/video/sn9c102/sn9c102_core.c

index f786ab11d2cd9b1a48cb0aff6bd70f85c19abd2f..86e353b26b53091c8deb0590ee18f272bead6d3a 100644 (file)
@@ -1182,8 +1182,6 @@ static void et61x251_release_resources(struct et61x251_device* cam)
        video_set_drvdata(cam->v4ldev, NULL);
        video_unregister_device(cam->v4ldev);
 
-       usb_put_dev(cam->usbdev);
-
        mutex_unlock(&et61x251_sysfs_lock);
 
        kfree(cam->control_buffer);
@@ -1275,6 +1273,7 @@ static int et61x251_release(struct inode* inode, struct file* filp)
 
        if (cam->state & DEV_DISCONNECTED) {
                et61x251_release_resources(cam);
+               usb_put_dev(cam->usbdev);
                mutex_unlock(&cam->dev_mutex);
                kfree(cam);
                return 0;
index a4702d3c2aca4f295faa28dff8ca5c9c37bf49e1..42fb60d985b999d5b939609de79a5e87449e6878 100644 (file)
@@ -1462,8 +1462,6 @@ static void sn9c102_release_resources(struct sn9c102_device* cam)
        video_set_drvdata(cam->v4ldev, NULL);
        video_unregister_device(cam->v4ldev);
 
-       usb_put_dev(cam->usbdev);
-
        mutex_unlock(&sn9c102_sysfs_lock);
 
        kfree(cam->control_buffer);
@@ -1555,6 +1553,7 @@ static int sn9c102_release(struct inode* inode, struct file* filp)
 
        if (cam->state & DEV_DISCONNECTED) {
                sn9c102_release_resources(cam);
+               usb_put_dev(cam->usbdev);
                mutex_unlock(&cam->dev_mutex);
                kfree(cam);
                return 0;