Skip to content

Commit 8e42749

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 80a0961 commit 8e42749

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
@@ -657,11 +657,9 @@ int module_adapter_params(struct comp_dev *dev, struct sof_ipc_stream_params *pa
657657
#endif
658658

659659
/* allocate stream_params each time */
660-
if (mod->stream_params)
661-
rfree(mod->stream_params);
660+
mod_free(mod, mod->stream_params);
662661

663-
mod->stream_params = rzalloc(SOF_MEM_FLAG_USER,
664-
sizeof(*mod->stream_params) + params->ext_data_length);
662+
mod->stream_params = mod_alloc(mod, sizeof(*mod->stream_params) + params->ext_data_length);
665663
if (!mod->stream_params)
666664
return -ENOMEM;
667665

@@ -1363,7 +1361,7 @@ int module_adapter_reset(struct comp_dev *dev)
13631361
buffer_zero(buffer);
13641362
}
13651363

1366-
rfree(mod->stream_params);
1364+
mod_free(mod, mod->stream_params);
13671365
mod->stream_params = NULL;
13681366

13691367
comp_dbg(dev, "done");
@@ -1397,7 +1395,6 @@ void module_adapter_free(struct comp_dev *dev)
13971395

13981396
mod_free_all(mod);
13991397

1400-
rfree(mod->stream_params);
14011398
module_adapter_mem_free(mod);
14021399
}
14031400
EXPORT_SYMBOL(module_adapter_free);

0 commit comments

Comments
 (0)