]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
[media] gscpa_vicam: Fix oops if unplugged while streaming
authorHans de Goede <hdegoede@redhat.com>
Thu, 29 Dec 2011 19:50:57 +0000 (16:50 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 30 Dec 2011 18:22:04 +0000 (16:22 -0200)
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/gspca/vicam.c

index 81dd4c99d025aedb51c8e344c083541f92fc8ac9..8423ee1c305c36546792e1d6b9337c349d8bcd17 100644 (file)
@@ -324,7 +324,8 @@ static void sd_stop0(struct gspca_dev *gspca_dev)
        dev->work_thread = NULL;
        mutex_lock(&gspca_dev->usb_lock);
 
-       vicam_set_camera_power(gspca_dev, 0);
+       if (gspca_dev->present)
+               vicam_set_camera_power(gspca_dev, 0);
 }
 
 /* Table of supported USB devices */