Skip to content

Commit

Permalink
[media] staging: media: go7007: firmware protection Protection for un…
Browse files Browse the repository at this point in the history
…firmware 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>
  • Loading branch information
Volokh Konstantin authored and Mauro Carvalho Chehab committed Feb 6, 2013
1 parent 61a2353 commit 7a295d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/staging/media/go7007/go7007-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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 = {
Expand Down
3 changes: 2 additions & 1 deletion drivers/staging/media/go7007/go7007-v4l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit 7a295d1

Please sign in to comment.