From 29332259846244c703b3b0bc78c384a583a4b2ca Mon Sep 17 00:00:00 2001 From: Sriharsha Allenki Date: Tue, 1 Dec 2020 14:36:07 +0530 Subject: [PATCH] usb: dwc3: core: Destroy ipc log context on remove The IPC log context and the log buffers allocated are not destroyed upon remove, this will lead to memory leak and cause memory allocation failures, if the probe fails indefinitely. Change-Id: I6844507cb5c5bec4908f34b3f00090594d2cefcf Signed-off-by: Sriharsha Allenki --- drivers/usb/dwc3/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 903c4fa20308..95ed745ce6a3 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -1724,6 +1724,8 @@ static int dwc3_remove(struct platform_device *pdev) ipc_log_context_destroy(dwc->dwc_ipc_log_ctxt); dwc->dwc_ipc_log_ctxt = NULL; + ipc_log_context_destroy(dwc->dwc_dma_ipc_log_ctxt); + dwc->dwc_dma_ipc_log_ctxt = NULL; count--; dwc3_instance[dwc->index] = NULL;