module_adapter: fix double-free of base_cfg_ext data

Fix handling of input_pins free. Module reset can be called multiple times,
so move the resource release to module_adapter_free().

Fixes: 7046004384 ("module_adapter_ipc4: Save and pre-parse base_cfg_ext data")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
This commit is contained in:
Kai Vehmanen 2024-01-24 21:03:01 +02:00 committed by Kai Vehmanen
parent ff9343aa4a
commit c3da4e3d62
1 changed files with 4 additions and 4 deletions

View File

@ -1338,10 +1338,6 @@ int module_adapter_reset(struct comp_dev *dev)
rfree(mod->stream_params);
mod->stream_params = NULL;
#if CONFIG_IPC_MAJOR_4
rfree(mod->priv.cfg.input_pins);
#endif
comp_dbg(dev, "module_adapter_reset(): done");
return comp_set_state(dev, COMP_TRIGGER_RESET);
@ -1371,6 +1367,10 @@ void module_adapter_free(struct comp_dev *dev)
buffer_free(buffer);
}
#if CONFIG_IPC_MAJOR_4
rfree(mod->priv.cfg.input_pins);
#endif
rfree(mod);
rfree(dev);
}