Skip to content

Commit 53bdeb4

Browse files
committed
module-adapter: move stream parameters to the module heap
Stream parameters are only used by respective modules, move them to the module's own heap. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent 6643ea8 commit 53bdeb4

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

src/audio/module_adapter/module_adapter.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -666,11 +666,9 @@ int module_adapter_params(struct comp_dev *dev, struct sof_ipc_stream_params *pa
666666
#endif
667667

668668
/* allocate stream_params each time */
669-
if (mod->stream_params)
670-
rfree(mod->stream_params);
669+
mod_free(mod, mod->stream_params);
671670

672-
mod->stream_params = rzalloc(SOF_MEM_FLAG_USER,
673-
sizeof(*mod->stream_params) + params->ext_data_length);
671+
mod->stream_params = mod_alloc(mod, sizeof(*mod->stream_params) + params->ext_data_length);
674672
if (!mod->stream_params)
675673
return -ENOMEM;
676674

@@ -1372,7 +1370,7 @@ int module_adapter_reset(struct comp_dev *dev)
13721370
buffer_zero(buffer);
13731371
}
13741372

1375-
rfree(mod->stream_params);
1373+
mod_free(mod, mod->stream_params);
13761374
mod->stream_params = NULL;
13771375

13781376
comp_dbg(dev, "done");
@@ -1406,7 +1404,6 @@ void module_adapter_free(struct comp_dev *dev)
14061404

14071405
mod_free_all(mod);
14081406

1409-
rfree(mod->stream_params);
14101407
module_adapter_mem_free(mod);
14111408
}
14121409
EXPORT_SYMBOL(module_adapter_free);

0 commit comments

Comments
 (0)