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>
        struct urb *vurb, *aurb;
        int i;
 
-       go->status = STATUS_SHUTDOWN;
        usb_kill_urb(usb->intr_urb);
 
        /* Free USB-related structs */
        kfree(go->hpi_context);
 
        go7007_remove(go);
+       go->status = STATUS_SHUTDOWN;
 }
 
 static struct usb_driver go7007_usb_driver = {
 
        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);
 }