From: Hans de Goede Date: Thu, 29 Dec 2011 19:50:57 +0000 (-0300) Subject: [media] gscpa_vicam: Fix oops if unplugged while streaming X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=27d3e366091b13c26d5d996709fd9d99858455eb;p=linux-beck.git [media] gscpa_vicam: Fix oops if unplugged while streaming Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/gspca/vicam.c b/drivers/media/video/gspca/vicam.c index 81dd4c99d025..8423ee1c305c 100644 --- a/drivers/media/video/gspca/vicam.c +++ b/drivers/media/video/gspca/vicam.c @@ -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 */