mirror of https://github.com/thesofproject/sof.git
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:
parent
ff9343aa4a
commit
c3da4e3d62
|
@ -1338,10 +1338,6 @@ int module_adapter_reset(struct comp_dev *dev)
|
||||||
rfree(mod->stream_params);
|
rfree(mod->stream_params);
|
||||||
mod->stream_params = NULL;
|
mod->stream_params = NULL;
|
||||||
|
|
||||||
#if CONFIG_IPC_MAJOR_4
|
|
||||||
rfree(mod->priv.cfg.input_pins);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
comp_dbg(dev, "module_adapter_reset(): done");
|
comp_dbg(dev, "module_adapter_reset(): done");
|
||||||
|
|
||||||
return comp_set_state(dev, COMP_TRIGGER_RESET);
|
return comp_set_state(dev, COMP_TRIGGER_RESET);
|
||||||
|
@ -1371,6 +1367,10 @@ void module_adapter_free(struct comp_dev *dev)
|
||||||
buffer_free(buffer);
|
buffer_free(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if CONFIG_IPC_MAJOR_4
|
||||||
|
rfree(mod->priv.cfg.input_pins);
|
||||||
|
#endif
|
||||||
|
|
||||||
rfree(mod);
|
rfree(mod);
|
||||||
rfree(dev);
|
rfree(dev);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue