diff options
author | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2009-12-09 18:58:58 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-02 17:53:08 -0500 |
commit | c01591bd6ece72e1c099cbc25ed812e1add579dc (patch) | |
tree | 6773c823e19ac6685af1cd06fa1e7bbb4ebf0a58 /drivers/usb/host | |
parent | f661c6f8c67bd55e93348f160d590ff9edf08904 (diff) |
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 <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/xhci-hcd.c | 2 |
1 files changed, 2 insertions, 0 deletions
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, | |||
1181 | ret = xhci_queue_evaluate_context(xhci, in_ctx->dma, | 1181 | ret = xhci_queue_evaluate_context(xhci, in_ctx->dma, |
1182 | udev->slot_id); | 1182 | udev->slot_id); |
1183 | if (ret < 0) { | 1183 | if (ret < 0) { |
1184 | if (command) | ||
1185 | list_del(&command->cmd_list); | ||
1184 | spin_unlock_irqrestore(&xhci->lock, flags); | 1186 | spin_unlock_irqrestore(&xhci->lock, flags); |
1185 | xhci_dbg(xhci, "FIXME allocate a new ring segment\n"); | 1187 | xhci_dbg(xhci, "FIXME allocate a new ring segment\n"); |
1186 | return -ENOMEM; | 1188 | return -ENOMEM; |