[media] gspca_gl860: Add a present check to sd_stop0
authorHans de Goede <hdegoede@redhat.com>
Mon, 7 May 2012 09:53:27 +0000 (06:53 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 14 May 2012 12:33:25 +0000 (09:33 -0300)
The sensor specific dev_post_unset_alt functions all try to write to the
bridge, and none free any memory, so they should be skipped if stop0
is called on disconnection.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/gspca/gl860/gl860.c

index c84e26006fc386afef472a7a09fa52e4a6b572d5..c549574c1c7ea195744e083bf5c94b2aa8d36239 100644 (file)
@@ -405,6 +405,9 @@ static void sd_stop0(struct gspca_dev *gspca_dev)
 {
        struct sd *sd = (struct sd *) gspca_dev;
 
+       if (!sd->gspca_dev.present)
+               return;
+
        return sd->dev_post_unset_alt(gspca_dev);
 }