]>
Commit | Line | Data |
---|---|---|
34a069e8 GKH |
1 | From d9b4330adec006c2e8907bdcacd9dcc0e8874d18 Mon Sep 17 00:00:00 2001 |
2 | From: Felipe Balbi <balbi@ti.com> | |
3 | Date: Fri, 8 Feb 2013 15:14:16 +0200 | |
4 | Subject: usb: dwc3: core: don't forget to free coherent memory | |
5 | ||
6 | From: Felipe Balbi <balbi@ti.com> | |
7 | ||
8 | commit d9b4330adec006c2e8907bdcacd9dcc0e8874d18 upstream. | |
9 | ||
10 | commit 3921426 (usb: dwc3: core: move | |
11 | event buffer allocation out of | |
12 | dwc3_core_init()) introduced a memory leak | |
13 | of the coherent memory we use as event | |
14 | buffers on dwc3 driver. | |
15 | ||
16 | If the driver is compiled as a dynamically | |
17 | loadable module and use constantly loads | |
18 | and unloads the driver, we will continue | |
19 | to leak the coherent memory allocated during | |
20 | ->probe() because dwc3_free_event_buffers() | |
21 | is never called during ->remove(). | |
22 | ||
23 | Signed-off-by: Felipe Balbi <balbi@ti.com> | |
24 | Signed-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; |