From: Hans de Goede Date: Mon, 7 May 2012 09:53:27 +0000 (-0300) Subject: [media] gspca_gl860: Add a present check to sd_stop0 X-Git-Tag: v3.5-rc1~104^2~256 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=45432d41a2eebf5daaacb81de37fbfffc0a8faa7;p=thirdparty%2Fkernel%2Flinux.git [media] gspca_gl860: Add a present check to sd_stop0 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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/gspca/gl860/gl860.c b/drivers/media/video/gspca/gl860/gl860.c index c84e26006fc38..c549574c1c7ea 100644 --- a/drivers/media/video/gspca/gl860/gl860.c +++ b/drivers/media/video/gspca/gl860/gl860.c @@ -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); }