Skip to content

Commit 3d59eae

Browse files
ujfalusibroonie
authored andcommitted
ASoC: SOF: topology: No need to assign core ID if token parsing failed
Move the return value check before attempting to assign the core ID to the swidget since we are going to fail the sof_widget_ready() and free up swidget anyways. Fixes: 909dadf ("ASoC: SOF: topology: Make DAI widget parsing IPC agnostic") Signed-off-by: Peter Ujfalusi <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 314d34f commit 3d59eae

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

sound/soc/sof/topology.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,16 +1344,6 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index,
13441344
break;
13451345
}
13461346

1347-
if (sof_debug_check_flag(SOF_DBG_DISABLE_MULTICORE)) {
1348-
swidget->core = SOF_DSP_PRIMARY_CORE;
1349-
} else {
1350-
int core = sof_get_token_value(SOF_TKN_COMP_CORE_ID, swidget->tuples,
1351-
swidget->num_tuples);
1352-
1353-
if (core >= 0)
1354-
swidget->core = core;
1355-
}
1356-
13571347
/* check token parsing reply */
13581348
if (ret < 0) {
13591349
dev_err(scomp->dev,
@@ -1365,6 +1355,16 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index,
13651355
return ret;
13661356
}
13671357

1358+
if (sof_debug_check_flag(SOF_DBG_DISABLE_MULTICORE)) {
1359+
swidget->core = SOF_DSP_PRIMARY_CORE;
1360+
} else {
1361+
int core = sof_get_token_value(SOF_TKN_COMP_CORE_ID, swidget->tuples,
1362+
swidget->num_tuples);
1363+
1364+
if (core >= 0)
1365+
swidget->core = core;
1366+
}
1367+
13681368
/* bind widget to external event */
13691369
if (tw->event_type) {
13701370
if (widget_ops[w->id].bind_event) {

0 commit comments

Comments
 (0)