Commit 9e0904b2 authored by Mathias Nyman's avatar Mathias Nyman Committed by Kamal Mostafa

xhci: don't dereference a xhci member after removing xhci

BugLink: http://bugs.launchpad.net/bugs/1621113

commit f1f6d9a8 upstream.

Remove the hcd after checking for the xhci last quirks, not before.

This caused a hang on a Alpine Ridge xhci based maching which remove
the whole xhci controller when unplugging the last usb device
Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 0871647a
...@@ -311,11 +311,12 @@ static void xhci_pci_remove(struct pci_dev *dev) ...@@ -311,11 +311,12 @@ static void xhci_pci_remove(struct pci_dev *dev)
usb_remove_hcd(xhci->shared_hcd); usb_remove_hcd(xhci->shared_hcd);
usb_put_hcd(xhci->shared_hcd); usb_put_hcd(xhci->shared_hcd);
} }
usb_hcd_pci_remove(dev);
/* Workaround for spurious wakeups at shutdown with HSW */ /* Workaround for spurious wakeups at shutdown with HSW */
if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
pci_set_power_state(dev, PCI_D3hot); pci_set_power_state(dev, PCI_D3hot);
usb_hcd_pci_remove(dev);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
......
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