Skip to content

Commit 33b6831

Browse files
committed
audio: module-adapter: allocate pins on module heap
Allocate input and output pins on module heap for automatic freeing. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent c4d7351 commit 33b6831

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

src/audio/module_adapter/module_adapter.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,7 @@ static void module_adapter_mem_free(struct processing_module *mod)
144144
struct k_heap *mod_heap = mod->priv.resources.heap;
145145

146146
#if CONFIG_IPC_MAJOR_4
147-
const struct comp_driver *drv = mod->dev->drv;
148-
149-
sof_heap_free(drv->user_heap, mod->priv.cfg.input_pins);
147+
sof_heap_free(mod_heap, mod->priv.cfg.input_pins);
150148
#endif
151149
sof_heap_free(mod_heap, mod->dev);
152150
sof_heap_free(mod_heap, mod);

src/audio/module_adapter/module_adapter_ipc4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ int module_adapter_init_data(struct comp_dev *dev,
136136
if (cfgsz == (sizeof(*cfg) + pinsz)) {
137137
dst->nb_input_pins = n_in;
138138
dst->nb_output_pins = n_out;
139-
dst->input_pins = sof_heap_alloc(dev->drv->user_heap,
139+
dst->input_pins = sof_heap_alloc(dev->mod->priv.resources.heap,
140140
SOF_MEM_FLAG_USER | SOF_MEM_FLAG_COHERENT,
141141
pinsz, 0);
142142
if (!dst->input_pins)

0 commit comments

Comments
 (0)