Skip to content

Commit

Permalink
ipc3: override type field once comp_driver found
Browse files Browse the repository at this point in the history
A bad IPC can mismatch UUID and type, causing downstream processes to
operate differently than the final component target. This is because
get_drv will not reject the mismatch and given we don't know the
state of topology we can't start now. Instead we can override the ipc
with the proper type.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
  • Loading branch information
cujomalainey committed Sep 19, 2024
1 parent 88cde10 commit 80164bc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ipc/ipc3/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,11 @@ struct comp_dev *comp_new(struct sof_ipc_comp *comp)
if (!drv)
return NULL;

/* Hack to fix mismatch between uuid and type as most downstream
* systems match on the type but get_drv will match on uuid if present.
**/
comp->type = drv->type;

/* validate size of ipc config */
if (IPC_IS_SIZE_INVALID(*comp_config(comp))) {
IPC_SIZE_ERROR_TRACE(&comp_tr, *comp_config(comp));
Expand Down

0 comments on commit 80164bc

Please sign in to comment.