| From | Greg Kroah-Hartman <> | Subject | [PATCH 4.17 52/66] usb: xhci: Fix memory leak in xhci_endpoint_reset() | Date | Fri, 27 Jul 2018 11:45:45 +0200 |
| |
4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zheng Xiaowei <zhengxiaowei@ruijie.com.cn>
commit d89b7664f76047e7beca8f07e86f2ccfad085a28 upstream.
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>
--- drivers/usb/host/xhci.c | 1 + 1 file changed, 1 insertion(+)
--- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -2981,6 +2981,7 @@ static void xhci_endpoint_reset(struct u 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);
|