Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce1f8612 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "xhci-hub: Handle error condition with xhci_stop_device"

parents bcde0fdb fdb66729
Loading
Loading
Loading
Loading
+14 −3
Original line number Diff line number Diff line
@@ -294,11 +294,20 @@ static int xhci_stop_device(struct xhci_hcd *xhci, int slot_id, int suspend)
				return -ENOMEM;

			}
			xhci_queue_stop_endpoint(xhci, command, slot_id, i,
						 suspend);

			ret = xhci_queue_stop_endpoint(xhci, command, slot_id,
					i, suspend);
			if (ret) {
				spin_unlock_irqrestore(&xhci->lock, flags);
				goto err_cmd_queue;
			}
		}
	}
	xhci_queue_stop_endpoint(xhci, cmd, slot_id, 0, suspend);
	ret = xhci_queue_stop_endpoint(xhci, cmd, slot_id, 0, suspend);
	if (ret) {
		spin_unlock_irqrestore(&xhci->lock, flags);
		goto err_cmd_queue;
	}
	xhci_ring_cmd_db(xhci);
	spin_unlock_irqrestore(&xhci->lock, flags);

@@ -309,6 +318,8 @@ static int xhci_stop_device(struct xhci_hcd *xhci, int slot_id, int suspend)
		xhci_warn(xhci, "Timeout while waiting for stop endpoint command\n");
		ret = -ETIME;
	}

err_cmd_queue:
	xhci_free_command(xhci, cmd);
	return ret;
}