summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorChancel Liu <chancel.liu@nxp.com>2024-03-05 09:56:06 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-04-13 14:10:10 +0300
commitac372b78dd159718a13d9324709b0ac4cc641e1c (patch)
treeefa615dabd28f6a3a4c9690aee98d63b4a178da9 /sound
parenta2a46bbc6cb413252985864ead3a1ffa334b8e0a (diff)
downloadlinux-ac372b78dd159718a13d9324709b0ac4cc641e1c.tar.xz
ASoC: soc-core.c: Skip dummy codec when adding platforms
[ Upstream commit 23fb6bc2696119391ec3a92ccaffe50e567c515e ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 516350533e73..8b5b583a2bad 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1218,6 +1218,9 @@ static int snd_soc_add_pcm_runtime(struct snd_soc_card *card,
if (!snd_soc_is_matching_component(platform, component))
continue;
+ if (snd_soc_component_is_dummy(component) && component->num_dai)
+ continue;
+
snd_soc_rtd_add_component(rtd, component);
}
}