diff options
author | Mathias Nyman <mathias.nyman@linux.intel.com> | 2016-08-16 03:18:06 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-16 03:42:47 -0400 |
commit | f1f6d9a8b540df22b87a5bf6bc104edaade81f47 (patch) | |
tree | 5b0bb03840f9f27eadfb3a5dea7e187aa2e4fdcb | |
parent | 88716a93766b8f095cdef37a8e8f2c93aa233b21 (diff) |
xhci: don't dereference a xhci member after removing xhci
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
CC: <stable@vger.kernel.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/host/xhci-pci.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index 4fd041bec332..d7b0f97abbad 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c | |||
@@ -314,11 +314,12 @@ static void xhci_pci_remove(struct pci_dev *dev) | |||
314 | usb_remove_hcd(xhci->shared_hcd); | 314 | usb_remove_hcd(xhci->shared_hcd); |
315 | usb_put_hcd(xhci->shared_hcd); | 315 | usb_put_hcd(xhci->shared_hcd); |
316 | } | 316 | } |
317 | usb_hcd_pci_remove(dev); | ||
318 | 317 | ||
319 | /* Workaround for spurious wakeups at shutdown with HSW */ | 318 | /* Workaround for spurious wakeups at shutdown with HSW */ |
320 | if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) | 319 | if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) |
321 | pci_set_power_state(dev, PCI_D3hot); | 320 | pci_set_power_state(dev, PCI_D3hot); |
321 | |||
322 | usb_hcd_pci_remove(dev); | ||
322 | } | 323 | } |
323 | 324 | ||
324 | #ifdef CONFIG_PM | 325 | #ifdef CONFIG_PM |