Skip to content

Commit 23fb6bc

Browse files
Chancel Liubroonie
authored andcommitted
ASoC: soc-core.c: Skip dummy codec when adding platforms
When pcm_runtime is adding platform components it will scan all registered components. In case of DPCM FE/BE some DAI links will configure dummy platform. However both dummy codec and dummy platform are using "snd-soc-dummy" as component->name. Dummy codec should be skipped when adding platforms otherwise there'll be overflow and UBSAN complains. Reported-by: Zhipeng Wang <zhipeng.wang_1@nxp.com> Signed-off-by: Chancel Liu <chancel.liu@nxp.com> Link: https://msgid.link/r/20240305065606.3778642-1-chancel.liu@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 10eb0d3 commit 23fb6bc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sound/soc/soc-core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,6 +1219,9 @@ static int snd_soc_add_pcm_runtime(struct snd_soc_card *card,
12191219
if (!snd_soc_is_matching_component(platform, component))
12201220
continue;
12211221

1222+
if (snd_soc_component_is_dummy(component) && component->num_dai)
1223+
continue;
1224+
12221225
snd_soc_rtd_add_component(rtd, component);
12231226
}
12241227
}

0 commit comments

Comments
 (0)