mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 23:25:07 +00:00
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>
This commit is contained in:
parent
f661c6f8c6
commit
c01591bd6e
1 changed files with 2 additions and 0 deletions
|
@ -1181,6 +1181,8 @@ static int xhci_configure_endpoint(struct xhci_hcd *xhci,
|
||||||
ret = xhci_queue_evaluate_context(xhci, in_ctx->dma,
|
ret = xhci_queue_evaluate_context(xhci, in_ctx->dma,
|
||||||
udev->slot_id);
|
udev->slot_id);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
if (command)
|
||||||
|
list_del(&command->cmd_list);
|
||||||
spin_unlock_irqrestore(&xhci->lock, flags);
|
spin_unlock_irqrestore(&xhci->lock, flags);
|
||||||
xhci_dbg(xhci, "FIXME allocate a new ring segment\n");
|
xhci_dbg(xhci, "FIXME allocate a new ring segment\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
Loading…
Reference in a new issue