Skip to content

Commit b139c85

Browse files
committed
module-adapter: fix memory leaks caused by DP dask
dev->task is allocated in scheduler_dp_task_init but a deallocation is missing, resulting in a 392-byte memory leak each time a DP task ends, eventually exhausting the heap memory. Signed-off-by: Jun Lai <jun.lai@dolby.com>
1 parent 58ac6c9 commit b139c85

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/audio/module_adapter/module_adapter.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ static void module_adapter_mem_free(struct processing_module *mod)
169169
* In principle it shouldn't even be needed to free individual objects
170170
* on the module heap since we're freeing the heap itself too
171171
*/
172+
#if CONFIG_ZEPHYR_DP_SCHEDULER
173+
if (mod->dev->task)
174+
sof_heap_free(mod_heap, mod->dev->task);
175+
#endif
172176
#if CONFIG_IPC_MAJOR_4
173177
sof_heap_free(mod_heap, mod->priv.cfg.input_pins);
174178
#endif

0 commit comments

Comments
 (0)