mirror of https://gitee.com/openkylin/linux.git
[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>
This commit is contained in:
parent
61a2353c70
commit
7a295d1289
|
@ -1245,7 +1245,6 @@ static void go7007_usb_disconnect(struct usb_interface *intf)
|
||||||
struct urb *vurb, *aurb;
|
struct urb *vurb, *aurb;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
go->status = STATUS_SHUTDOWN;
|
|
||||||
usb_kill_urb(usb->intr_urb);
|
usb_kill_urb(usb->intr_urb);
|
||||||
|
|
||||||
/* Free USB-related structs */
|
/* Free USB-related structs */
|
||||||
|
@ -1269,6 +1268,7 @@ static void go7007_usb_disconnect(struct usb_interface *intf)
|
||||||
kfree(go->hpi_context);
|
kfree(go->hpi_context);
|
||||||
|
|
||||||
go7007_remove(go);
|
go7007_remove(go);
|
||||||
|
go->status = STATUS_SHUTDOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct usb_driver go7007_usb_driver = {
|
static struct usb_driver go7007_usb_driver = {
|
||||||
|
|
|
@ -1832,5 +1832,6 @@ void go7007_v4l2_remove(struct go7007 *go)
|
||||||
mutex_unlock(&go->hw_lock);
|
mutex_unlock(&go->hw_lock);
|
||||||
if (go->video_dev)
|
if (go->video_dev)
|
||||||
video_unregister_device(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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue