Skip to content

Commit f1f6d9a

Browse files
matnymangregkh
authored andcommitted
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: <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 88716a9 commit f1f6d9a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/usb/host/xhci-pci.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,12 @@ static void xhci_pci_remove(struct pci_dev *dev)
314314
usb_remove_hcd(xhci->shared_hcd);
315315
usb_put_hcd(xhci->shared_hcd);
316316
}
317-
usb_hcd_pci_remove(dev);
318317

319318
/* Workaround for spurious wakeups at shutdown with HSW */
320319
if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
321320
pci_set_power_state(dev, PCI_D3hot);
321+
322+
usb_hcd_pci_remove(dev);
322323
}
323324

324325
#ifdef CONFIG_PM

0 commit comments

Comments
 (0)