Skip to content

Commit

Permalink
module_adapter: fix double-free of base_cfg_ext data
Browse files Browse the repository at this point in the history
Fix handling of input_pins free. Module reset can be called multiple times,
so move the resource release to module_adapter_free().

Fixes: 7046004 ("module_adapter_ipc4: Save and pre-parse base_cfg_ext data")
Signed-off-by: Kai Vehmanen <[email protected]>
  • Loading branch information
kv2019i committed Jan 25, 2024
1 parent ff9343a commit c3da4e3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/audio/module_adapter/module_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit c3da4e3

Please sign in to comment.