Commit d89b7664 authored by Zheng Xiaowei's avatar Zheng Xiaowei Committed by Greg Kroah-Hartman

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: default avatarZheng Xiaowei <zhengxiaowei@ruijie.com.cn>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c413767e
...@@ -3051,6 +3051,7 @@ static void xhci_endpoint_reset(struct usb_hcd *hcd, ...@@ -3051,6 +3051,7 @@ static void xhci_endpoint_reset(struct usb_hcd *hcd,
if (!list_empty(&ep->ring->td_list)) { if (!list_empty(&ep->ring->td_list)) {
dev_err(&udev->dev, "EP not empty, refuse reset\n"); dev_err(&udev->dev, "EP not empty, refuse reset\n");
spin_unlock_irqrestore(&xhci->lock, flags); spin_unlock_irqrestore(&xhci->lock, flags);
xhci_free_command(xhci, cfg_cmd);
goto cleanup; goto cleanup;
} }
xhci_queue_stop_endpoint(xhci, stop_cmd, udev->slot_id, ep_index, 0); xhci_queue_stop_endpoint(xhci, stop_cmd, udev->slot_id, ep_index, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment