Skip to content

Commit e3b3ec9

Browse files
AngeloGioacchino Del Regnobroonie
authored andcommitted
ASoC: mediatek: sof-common: Add NULL check for normal_link string
It's not granted that all entries of struct sof_conn_stream declare a `normal_link` (a non-SOF, direct link) string, and this is the case for SoCs that support only SOF paths (hence do not support both direct and SOF usecases). For example, in the case of MT8188 there is no normal_link string in any of the sof_conn_stream entries and there will be more drivers doing that in the future. To avoid possible NULL pointer KPs, add a NULL check for `normal_link`. Fixes: 0caf112 ("ASoC: mediatek: mt8195: extract SOF common code") Signed-off-by: AngeloGioacchino Del Regno <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent e70b8dd commit e3b3ec9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/soc/mediatek/common/mtk-dsp-sof-common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ int mtk_sof_dai_link_fixup(struct snd_soc_pcm_runtime *rtd,
2424
struct snd_soc_dai_link *sof_dai_link = NULL;
2525
const struct sof_conn_stream *conn = &sof_priv->conn_streams[i];
2626

27-
if (strcmp(rtd->dai_link->name, conn->normal_link))
27+
if (conn->normal_link && strcmp(rtd->dai_link->name, conn->normal_link))
2828
continue;
2929

3030
for_each_card_rtds(card, runtime) {

0 commit comments

Comments
 (0)