diff options
author | Jack Pham <jackp@codeaurora.org> | 2017-06-01 19:00:45 -0700 |
---|---|---|
committer | Jack Pham <jackp@codeaurora.org> | 2017-06-02 09:59:15 -0700 |
commit | f447dd3d321e99b95dd83f88fb140065920d96ed (patch) | |
tree | 29b23968b671b0a104f6d7b027971751a10563e3 /drivers/usb | |
parent | a4253a4598b6632a2e49f17fac5ed10abf43aae2 (diff) |
usb: xhci: Free leaked command in case xhci_queue_stop_endpoint fails
commit e3020f3887db ("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: Jack Pham <jackp@codeaurora.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/xhci-hub.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index 6c414f252291..9dbd7595a7a3 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c @@ -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; } } |