]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.8.4/usb-dwc3-core-don-t-forget-to-free-coherent-memory.patch
Linux 4.14.95
[thirdparty/kernel/stable-queue.git] / releases / 3.8.4 / usb-dwc3-core-don-t-forget-to-free-coherent-memory.patch
CommitLineData
34a069e8
GKH
1From d9b4330adec006c2e8907bdcacd9dcc0e8874d18 Mon Sep 17 00:00:00 2001
2From: Felipe Balbi <balbi@ti.com>
3Date: Fri, 8 Feb 2013 15:14:16 +0200
4Subject: usb: dwc3: core: don't forget to free coherent memory
5
6From: Felipe Balbi <balbi@ti.com>
7
8commit d9b4330adec006c2e8907bdcacd9dcc0e8874d18 upstream.
9
10commit 3921426 (usb: dwc3: core: move
11event buffer allocation out of
12dwc3_core_init()) introduced a memory leak
13of the coherent memory we use as event
14buffers on dwc3 driver.
15
16If the driver is compiled as a dynamically
17loadable module and use constantly loads
18and unloads the driver, we will continue
19to leak the coherent memory allocated during
20->probe() because dwc3_free_event_buffers()
21is never called during ->remove().
22
23Signed-off-by: Felipe Balbi <balbi@ti.com>
24Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25
26---
27 drivers/usb/dwc3/core.c | 1 +
28 1 file changed, 1 insertion(+)
29
30--- a/drivers/usb/dwc3/core.c
31+++ b/drivers/usb/dwc3/core.c
32@@ -575,6 +575,7 @@ static int dwc3_remove(struct platform_d
33 break;
34 }
35
36+ dwc3_free_event_buffers(dwc);
37 dwc3_core_exit(dwc);
38
39 return 0;