aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/media
diff options
context:
space:
mode:
authorVolokh Konstantin <volokh84@gmail.com>2013-01-16 09:00:49 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-02-06 09:01:11 -0200
commit7a295d1289f2be16f80f0a5242db330d542e0037 (patch)
treeb5b9def835a619f003ec4621f3eaa2216b71fd2e /drivers/staging/media
parent[media] staging: media: go7007: memory clear fix memory clearing for v4l2_subdev allocation (diff)
downloadlinux-dev-7a295d1289f2be16f80f0a5242db330d542e0037.tar.xz
linux-dev-7a295d1289f2be16f80f0a5242db330d542e0037.zip
[media] staging: media: go7007: firmware protection Protection for unfirmware load
If no firmware was loaded (no exists,wrong or some error) then rmmod fails with OOPS, so need some protection stuff. Signed-off-by: Volokh Konstantin <volokh84@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/staging/media')
-rw-r--r--drivers/staging/media/go7007/go7007-usb.c2
-rw-r--r--drivers/staging/media/go7007/go7007-v4l2.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/media/go7007/go7007-usb.c b/drivers/staging/media/go7007/go7007-usb.c
index 5443e25086e9..a6cad1589475 100644
--- a/drivers/staging/media/go7007/go7007-usb.c
+++ b/drivers/staging/media/go7007/go7007-usb.c
@@ -1245,7 +1245,6 @@ static void go7007_usb_disconnect(struct usb_interface *intf)
struct urb *vurb, *aurb;
int i;
- go->status = STATUS_SHUTDOWN;
usb_kill_urb(usb->intr_urb);
/* Free USB-related structs */
@@ -1269,6 +1268,7 @@ static void go7007_usb_disconnect(struct usb_interface *intf)
kfree(go->hpi_context);
go7007_remove(go);
+ go->status = STATUS_SHUTDOWN;
}
static struct usb_driver go7007_usb_driver = {
diff --git a/drivers/staging/media/go7007/go7007-v4l2.c b/drivers/staging/media/go7007/go7007-v4l2.c
index 94899759229f..39e6749353be 100644
--- a/drivers/staging/media/go7007/go7007-v4l2.c
+++ b/drivers/staging/media/go7007/go7007-v4l2.c
@@ -1832,5 +1832,6 @@ void go7007_v4l2_remove(struct go7007 *go)
mutex_unlock(&go->hw_lock);
if (go->video_dev)
video_unregister_device(go->video_dev);
- v4l2_device_unregister(&go->v4l2_dev);
+ if (go->status != STATUS_SHUTDOWN)
+ v4l2_device_unregister(&go->v4l2_dev);
}