summaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorMathias Nyman <mathias.nyman@linux.intel.com>2016-08-16 10:18:06 +0300
committerBen Hutchings <ben@decadent.org.uk>2016-11-20 01:17:12 +0000
commit61d42d40f14affecbab94c07ba2a5a847935c2f8 (patch)
tree5654f27068e23366e0fcd92bb6abe31c47c77d8a /drivers/usb/host
parent87dff6d9604f0d48b1fbd4dd5268673d7e32d458 (diff)
downloadlinux-stable-61d42d40f14affecbab94c07ba2a5a847935c2f8.tar.gz
linux-stable-61d42d40f14affecbab94c07ba2a5a847935c2f8.tar.bz2
linux-stable-61d42d40f14affecbab94c07ba2a5a847935c2f8.zip
xhci: don't dereference a xhci member after removing xhci
commit f1f6d9a8b540df22b87a5bf6bc104edaade81f47 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: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [bwh: Backported to 3.16: adjust context] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/xhci-pci.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index 4b36d8562eef..015d4c08a3cb 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -293,12 +293,13 @@ static void xhci_pci_remove(struct pci_dev *dev)
usb_remove_hcd(xhci->shared_hcd);
usb_put_hcd(xhci->shared_hcd);
}
- usb_hcd_pci_remove(dev);
/* Workaround for spurious wakeups at shutdown with HSW */
if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
pci_set_power_state(dev, PCI_D3hot);
+ usb_hcd_pci_remove(dev);
+
kfree(xhci);
}