diff options
author | Zheng Xiaowei <zhengxiaowei@ruijie.com.cn> | 2018-07-20 18:05:11 +0300 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2018-08-09 17:19:51 +0200 |
commit | 2b18d73ed18118964f1e7bcbf0764abcd1d8b7f3 (patch) | |
tree | a8e5379033f9df772efbfac52c0ce4297e940819 | |
parent | 9f3a6c934772f389904f8649ae5bdf52fd9f0df5 (diff) | |
download | renesas-backport-2b18d73ed18118964f1e7bcbf0764abcd1d8b7f3.tar.gz |
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>
(cherry picked from commit d89b7664f76047e7beca8f07e86f2ccfad085a28)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r-- | drivers/usb/host/xhci.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index f4e3db0826ef30..21736f55e39c6b 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, if (!list_empty(&ep->ring->td_list)) { dev_err(&udev->dev, "EP not empty, refuse reset\n"); spin_unlock_irqrestore(&xhci->lock, flags); + xhci_free_command(xhci, cfg_cmd); goto cleanup; } xhci_queue_stop_endpoint(xhci, stop_cmd, udev->slot_id, ep_index, 0); |