|
@@ -3561,11 +3561,9 @@ static void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev)
|
|
|
del_timer_sync(&virt_dev->eps[i].stop_cmd_timer);
|
|
|
}
|
|
|
|
|
|
- xhci_disable_slot(xhci, udev->slot_id);
|
|
|
- /*
|
|
|
- * Event command completion handler will free any data structures
|
|
|
- * associated with the slot. XXX Can free sleep?
|
|
|
- */
|
|
|
+ ret = xhci_disable_slot(xhci, udev->slot_id);
|
|
|
+ if (ret)
|
|
|
+ xhci_free_virt_device(xhci, udev->slot_id);
|
|
|
}
|
|
|
|
|
|
int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id)
|
|
@@ -3713,7 +3711,11 @@ int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev)
|
|
|
return 1;
|
|
|
|
|
|
disable_slot:
|
|
|
- return xhci_disable_slot(xhci, udev->slot_id);
|
|
|
+ ret = xhci_disable_slot(xhci, udev->slot_id);
|
|
|
+ if (ret)
|
|
|
+ xhci_free_virt_device(xhci, udev->slot_id);
|
|
|
+
|
|
|
+ return 0;
|
|
|
}
|
|
|
|
|
|
/*
|