Skip to contentSkip to conversation

patch "usb: xhci: Fix memory leak in xhci_endpoint_reset()" added to usb-linus

PATCH [email protected] 1 participant 1 message Jul 20, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

usb: xhci: Fix memory leak in xhci_endpoint_reset()

to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

Quoted 1 line

From d89b7664f76047e7beca8f07e86f2ccfad085a28 Mon Sep 17 00:00:00 2001

From: Zheng Xiaowei <[email protected]>
Date: Fri, 20 Jul 2018 18:05:11 +0300
Subject: 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.

---
 drivers/usb/host/xhci.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/host/xhci.c +1 -0
index 2f4850f25e82..68e6132aa8b2 100644
@@ -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);
Signature · 1 line
2.18.0