summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorRichard Fitzgerald <rf@opensource.cirrus.com>2025-09-19 15:02:35 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-15 12:00:13 +0200
commitaea038062edfca9c6e5ddcecd4611d5a80113b4e (patch)
tree8ae8b651a3074a79d8e054e306b89a8f2e1407b0 /sound
parent1c873416758f83d9ea8a90803fcff4a534863b76 (diff)
downloadlinux-aea038062edfca9c6e5ddcecd4611d5a80113b4e.tar.gz
linux-aea038062edfca9c6e5ddcecd4611d5a80113b4e.tar.bz2
linux-aea038062edfca9c6e5ddcecd4611d5a80113b4e.zip
ASoC: Intel: sof_sdw: Prevent jump to NULL add_sidecar callback
[ Upstream commit 87cab86925b7fa4c1c977bc191ac549a3b23f0ea ] In create_sdw_dailink() check that sof_end->codec_info->add_sidecar is not NULL before calling it. The original code assumed that if include_sidecar is true, the codec on that link has an add_sidecar callback. But there could be other codecs on the same link that do not have an add_sidecar callback. Fixes: da5244180281 ("ASoC: Intel: sof_sdw: Add callbacks to register sidecar devices") Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20250919140235.1071941-1-rf@opensource.cirrus.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/intel/boards/sof_sdw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c
index 5911a0558651..00d840d5e585 100644
--- a/sound/soc/intel/boards/sof_sdw.c
+++ b/sound/soc/intel/boards/sof_sdw.c
@@ -741,7 +741,7 @@ static int create_sdw_dailink(struct snd_soc_card *card,
(*codec_conf)++;
}
- if (sof_end->include_sidecar) {
+ if (sof_end->include_sidecar && sof_end->codec_info->add_sidecar) {
ret = sof_end->codec_info->add_sidecar(card, dai_links, codec_conf);
if (ret)
return ret;