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 <sallenki@codeaurora.org>
This commit is contained in:
Sriharsha Allenki 2020-12-01 14:36:07 +05:30 • committed by Gerrit - the friendly Code Review server
commit 2933225984

View file

@ -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;