Skip to content

Commit e01b4f6

Browse files
lrgirdwobroonie
authored andcommitted
ASoC: dapm: Fix potential DAI widget pointer deref when linking DAIs
Sometime a component or topology may configure a DAI widget with no private data leading to a dev_dbg() dereferencne of this data. Fix this to check for non NULL private data and let users know if widget is missing DAI. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 5544717 commit e01b4f6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sound/soc/soc-dapm.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4073,6 +4073,13 @@ int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card)
40734073
continue;
40744074
}
40754075

4076+
/* let users know there is no DAI to link */
4077+
if (!dai_w->priv) {
4078+
dev_dbg(card->dev, "dai widget %s has no DAI\n",
4079+
dai_w->name);
4080+
continue;
4081+
}
4082+
40764083
dai = dai_w->priv;
40774084

40784085
/* ...find all widgets with the same stream and link them */

0 commit comments

Comments
 (0)