Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/ipc/ipc4/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,23 @@ __cold struct comp_dev *comp_new_ipc4(struct ipc4_module_init_instance *module_i
ipc_config.ipc_config_size);
return NULL;
}

/*
* The parent pipeline referenced by ppl_instance_id must already exist.
* IPC4 requires the host to create the pipeline (SOF_IPC4_GLB_CREATE_PIPELINE)
* before instantiating any module inside it. Validate the reference here, at
* the common creation entry point, before allocating the component. This
* guarantees the "a live IPC4 component always belongs to a live pipeline"
* invariant for every driver, so no module init path (e.g. the copier writing
* pipeline->source_comp / pipeline->sink_comp) can dereference a NULL
* dev->pipeline.
*/
if (!ipc_get_comp_by_ppl_id(ipc_get(), COMP_TYPE_PIPELINE, ipc_config.pipeline_id,
IPC_COMP_IGNORE_REMOTE)) {
tr_err(&ipc_tr, "comp 0x%x: parent pipeline %u does not exist", comp_id,
(uint32_t)ipc_config.pipeline_id);
return NULL;
}
#ifdef CONFIG_DCACHE_LINE_SIZE
if (!IS_ENABLED(CONFIG_LIBRARY))
sys_cache_data_invd_range((__sparse_force void __sparse_cache *)
Expand Down
Loading