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

Commit f447dd3d authored by Jack Pham's avatar Jack Pham
Browse files

usb: xhci: Free leaked command in case xhci_queue_stop_endpoint fails



commit e3020f38 ("xhci-hub: Handle error condition with
xhci_stop_device") added error checking to xhci_stop_device()
if xhci_queue_stop_endpoint() returns an error. However, the
command structure allocated was not getting freed in that case.
Fix the leak.

Change-Id: Ibc28e32c9e2d402db0c47bfe759dd442d3ab184f
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent a4253a45
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -406,6 +406,7 @@ static int xhci_stop_device(struct xhci_hcd *xhci, int slot_id, int suspend)
					i, suspend);
			if (ret) {
				spin_unlock_irqrestore(&xhci->lock, flags);
				xhci_free_command(xhci, command);
				goto err_cmd_queue;
			}
		}