Skip to content

Commit b5e48ed

Browse files
committed
module_adapter: Fill module fields before starting dp thread
Move mod field initialization in module_adapter_new_ext() before creating the dp thread. Moving the initialization earlier prevents the dp thread from use uninitialized data. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
1 parent 96ab79a commit b5e48ed

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/audio/module_adapter/module_adapter.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,12 @@ struct comp_dev *module_adapter_new_ext(const struct comp_driver *drv,
226226
if (!mod)
227227
return NULL;
228228

229+
module_set_private_data(mod, mod_priv);
230+
list_init(&mod->raw_data_buffers_list);
231+
#if CONFIG_USERSPACE
232+
mod->user_ctx = user_ctx;
233+
#endif /* CONFIG_USERSPACE */
234+
229235
struct comp_dev *dev = mod->dev;
230236

231237
#if CONFIG_ZEPHYR_DP_SCHEDULER
@@ -236,12 +242,6 @@ struct comp_dev *module_adapter_new_ext(const struct comp_driver *drv,
236242
}
237243
#endif /* CONFIG_ZEPHYR_DP_SCHEDULER */
238244

239-
module_set_private_data(mod, mod_priv);
240-
list_init(&mod->raw_data_buffers_list);
241-
#if CONFIG_USERSPACE
242-
mod->user_ctx = user_ctx;
243-
#endif /* CONFIG_USERSPACE */
244-
245245
dst = &mod->priv.cfg;
246246
/*
247247
* NOTE: dst->ext_data points to stack variable and contains

0 commit comments

Comments
 (0)