Skip to content

Commit

Permalink
usb: dwc3: core: don't forget to free coherent memory
Browse files Browse the repository at this point in the history
commit 3921426 (usb: dwc3: core: move
event buffer allocation out of
dwc3_core_init()) introduced a memory leak
of the coherent memory we use as event
buffers on dwc3 driver.

If the driver is compiled as a dynamically
loadable module and use constantly loads
and unloads the driver, we will continue
to leak the coherent memory allocated during
->probe() because dwc3_free_event_buffers()
is never called during ->remove().

Cc: <stable@vger.kernel.org> # v3.7 v3.8
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Felipe Balbi committed Mar 4, 2013
1 parent 6dbe51c commit d9b4330
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/usb/dwc3/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ static int dwc3_remove(struct platform_device *pdev)
break;
}

dwc3_free_event_buffers(dwc);
dwc3_core_exit(dwc);

return 0;
Expand Down

0 comments on commit d9b4330

Please sign in to comment.