Commit ecfc6da8 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: fix problem with removing a USB root hub.

parent 2343ef93
...@@ -790,6 +790,7 @@ void usb_disconnect(struct usb_device **pdev) ...@@ -790,6 +790,7 @@ void usb_disconnect(struct usb_device **pdev)
usb_disconnect(child); usb_disconnect(child);
} }
dbg ("unregistering interfaces on device %d", dev->devnum);
if (dev->actconfig) { if (dev->actconfig) {
for (i = 0; i < dev->actconfig->bNumInterfaces; i++) { for (i = 0; i < dev->actconfig->bNumInterfaces; i++) {
struct usb_interface *interface = &dev->actconfig->interface[i]; struct usb_interface *interface = &dev->actconfig->interface[i];
...@@ -799,12 +800,13 @@ void usb_disconnect(struct usb_device **pdev) ...@@ -799,12 +800,13 @@ void usb_disconnect(struct usb_device **pdev)
} }
} }
dbg ("unregistering the device %d", dev->devnum);
/* Free the device number and remove the /proc/bus/usb entry */ /* Free the device number and remove the /proc/bus/usb entry */
if (dev->devnum > 0) { if (dev->devnum > 0) {
clear_bit(dev->devnum, dev->bus->devmap.devicemap); clear_bit(dev->devnum, dev->bus->devmap.devicemap);
usbfs_remove_device(dev); usbfs_remove_device(dev);
device_unregister(&dev->dev);
} }
device_unregister(&dev->dev);
/* Decrement the reference count, it'll auto free everything when */ /* Decrement the reference count, it'll auto free everything when */
/* it hits 0 which could very well be now */ /* it hits 0 which could very well be now */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment