Commit 61897820 authored by Lu Baolu's avatar Lu Baolu Committed by Luis Henriques

usb: xhci: fix return value of xhci_setup_device()

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

commit 90797aee upstream.

xhci_setup_device() should return failure with correct error number
when xhci host has died, removed or halted.

During usb device enumeration, if usb host is not accessible (died,
removed or halted), the hc_driver->address_device() should return
a corresponding error code to usb core. But current xhci driver just
returns success. This misleads usb core to continue the enumeration
by reading the device descriptor, which will result in failure, and
users will get a misleading message like "device descriptor read/8,
error -110".
Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
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 avatarLuis Henriques <luis.henriques@canonical.com>
parent a70ddcd3
......@@ -3808,8 +3808,10 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev,
mutex_lock(&xhci->mutex);
if (xhci->xhc_state) /* dying, removing or halted */
if (xhci->xhc_state) { /* dying, removing or halted */
ret = -ESHUTDOWN;
goto out;
}
if (!udev->slot_id) {
xhci_dbg_trace(xhci, trace_xhci_dbg_address,
......
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