aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZheng Xiaowei <zhengxiaowei@ruijie.com.cn>2018-07-20 11:05:11 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-20 11:17:21 -0400
commitd89b7664f76047e7beca8f07e86f2ccfad085a28 (patch)
tree1d3f59acb0c39dbea8fb935e5e69ab5d338feaef
parentc413767e6698ae24ac1904827314470cacff1497 (diff)
usb: xhci: Fix memory leak in xhci_endpoint_reset()
If td_list is not empty the cfg_cmd will not be freed, call xhci_free_command to free it. Signed-off-by: Zheng Xiaowei <zhengxiaowei@ruijie.com.cn> Cc: <stable@vger.kernel.org> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/host/xhci.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 2f4850f25e82..68e6132aa8b2 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -3051,6 +3051,7 @@ static void xhci_endpoint_reset(struct usb_hcd *hcd,
3051 if (!list_empty(&ep->ring->td_list)) { 3051 if (!list_empty(&ep->ring->td_list)) {
3052 dev_err(&udev->dev, "EP not empty, refuse reset\n"); 3052 dev_err(&udev->dev, "EP not empty, refuse reset\n");
3053 spin_unlock_irqrestore(&xhci->lock, flags); 3053 spin_unlock_irqrestore(&xhci->lock, flags);
3054 xhci_free_command(xhci, cfg_cmd);
3054 goto cleanup; 3055 goto cleanup;
3055 } 3056 }
3056 xhci_queue_stop_endpoint(xhci, stop_cmd, udev->slot_id, ep_index, 0); 3057 xhci_queue_stop_endpoint(xhci, stop_cmd, udev->slot_id, ep_index, 0);