diff options
Diffstat (limited to 'drivers/usb/host/xhci-mem.c')
-rw-r--r-- | drivers/usb/host/xhci-mem.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 9c7ddf0f3a43..3ec2ac9636fe 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -1685,6 +1685,8 @@ void xhci_free_command(struct xhci_hcd *xhci, | |||
1685 | void xhci_mem_cleanup(struct xhci_hcd *xhci) | 1685 | void xhci_mem_cleanup(struct xhci_hcd *xhci) |
1686 | { | 1686 | { |
1687 | struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller); | 1687 | struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller); |
1688 | struct dev_info *dev_info, *next; | ||
1689 | unsigned long flags; | ||
1688 | int size; | 1690 | int size; |
1689 | int i; | 1691 | int i; |
1690 | 1692 | ||
@@ -1742,6 +1744,13 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) | |||
1742 | 1744 | ||
1743 | scratchpad_free(xhci); | 1745 | scratchpad_free(xhci); |
1744 | 1746 | ||
1747 | spin_lock_irqsave(&xhci->lock, flags); | ||
1748 | list_for_each_entry_safe(dev_info, next, &xhci->lpm_failed_devs, list) { | ||
1749 | list_del(&dev_info->list); | ||
1750 | kfree(dev_info); | ||
1751 | } | ||
1752 | spin_unlock_irqrestore(&xhci->lock, flags); | ||
1753 | |||
1745 | xhci->num_usb2_ports = 0; | 1754 | xhci->num_usb2_ports = 0; |
1746 | xhci->num_usb3_ports = 0; | 1755 | xhci->num_usb3_ports = 0; |
1747 | kfree(xhci->usb2_ports); | 1756 | kfree(xhci->usb2_ports); |
@@ -2328,6 +2337,8 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) | |||
2328 | if (xhci_setup_port_arrays(xhci, flags)) | 2337 | if (xhci_setup_port_arrays(xhci, flags)) |
2329 | goto fail; | 2338 | goto fail; |
2330 | 2339 | ||
2340 | INIT_LIST_HEAD(&xhci->lpm_failed_devs); | ||
2341 | |||
2331 | return 0; | 2342 | return 0; |
2332 | 2343 | ||
2333 | fail: | 2344 | fail: |