diff options
| author | Aniket Randive <aniket.randive@oss.qualcomm.com> | 2026-08-19 17:09:31 +0530 |
|---|---|---|
| committer | Vinod Koul <vkoul@kernel.org> | 2026-09-10 18:24:22 +0530 |
| commit | dd27c3f4d6108556b74b5f3f4d1d885269e7ffa3 (patch) | |
| tree | e94ecd1fd788edd3524c9c8ff0447474c090b3cc /tools/perf/scripts/python/stackcollapse.py | |
| parent | d09cd5e8bbc98969b5333015b45c525078ac0f6f (diff) | |
| download | linux-next-dd27c3f4d6108556b74b5f3f4d1d885269e7ffa3.tar.gz linux-next-dd27c3f4d6108556b74b5f3f4d1d885269e7ffa3.zip | |
dmaengine: qcom: gpi: Fix resource leaks as part of channel clean up
The gpi_ch_init() error handling paths do not fully clean up resources
when channel initialization fails.
The unwind paths iterate over the original channel pointer instead of
the channels stored in gpii->gchan[], preventing previously initialized
sibling channels from being properly reset and deallocated.
In addition, gpi_alloc_chan_resources() allocates ch_ring before calling
gpi_ch_init(), but does not release it when initialization fails,
resulting in a memory leak.
The event ring cleanup path also leaves the PM state unchanged after
freeing the ring. As a result, subsequent cleanup may incorrectly assume
that the ring is still allocated, leading to a redundant EV_CMD_DEALLOC
command and an attempt to deallocate an already released ring.
Fix the unwind paths to operate on the correct channels, release
ch_ring when channel initialization fails, and restore the event ring
PM state after freeing the ring.
Signed-off-by: Aniket Randive <aniket.randive@oss.qualcomm.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Mukesh Kumar Savaliya <mukesh.savaliya@oss.qualcomm.com>
Reviewed-by: Praveen Talari <praveen.talari@oss.qualcomm.com>
Link: https://patch.msgid.link/20260810-gpi_bug_fix-v2-1-60555394cbf9@oss.qualcomm.com
Link: https://patch.msgid.link/20260819-gpi_bug_fix-v3-1-4c97333e6f5b@oss.qualcomm.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
