diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index e443ace0a051db..2771854de068e8 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -3788,6 +3788,9 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev, u64 temp_64; struct xhci_command *command; + if (xhci->xhc_state) /* dying or halted */ + return -EINVAL; + if (!udev->slot_id) { xhci_dbg_trace(xhci, trace_xhci_dbg_address, "Bad Slot ID %d", udev->slot_id);