From: Sarah Sharp Date: Wed, 9 Dec 2009 23:58:58 +0000 (-0800) Subject: USB: xhci: Fix error path when configuring endpoints. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c01591bd6ece72e1c099cbc25ed812e1add579dc;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git USB: xhci: Fix error path when configuring endpoints. If we fail to queue an evaluate context command or a configure endpoint command to the command ring in xhci_configure_endpoint(), we need to remove the xhci_command structure from the device's command list before returning. If the command is left on the command list, it will sit there indefinitely, blocking commands submitted after this fails. Signed-off-by: Sarah Sharp Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/host/xhci-hcd.c b/drivers/usb/host/xhci-hcd.c index 5e92c72df642..0c5c1b2f3263 100644 --- a/drivers/usb/host/xhci-hcd.c +++ b/drivers/usb/host/xhci-hcd.c @@ -1181,6 +1181,8 @@ static int xhci_configure_endpoint(struct xhci_hcd *xhci, ret = xhci_queue_evaluate_context(xhci, in_ctx->dma, udev->slot_id); if (ret < 0) { + if (command) + list_del(&command->cmd_list); spin_unlock_irqrestore(&xhci->lock, flags); xhci_dbg(xhci, "FIXME allocate a new ring segment\n"); return -ENOMEM;