diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index baaf0fd69f1a..e7098e382d66 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1377,7 +1377,12 @@ static struct snd_soc_pcm_runtime *dpcm_get_be(struct snd_soc_card *card, be->cpu_dai->playback_widget ? be->cpu_dai->playback_widget->name : "(not set)"); - if (be->cpu_dai->playback_widget == widget) + if ((be->cpu_dai->playback_widget && + be->cpu_dai->playback_widget == widget && + (be->dai_link->stream_name && + !strcmp(be->dai_link->stream_name, + be->cpu_dai->playback_widget->sname))) || + be->codec_dai->playback_widget == widget) return be; for_each_rtd_codec_dai(be, i, dai) { @@ -1396,7 +1401,12 @@ static struct snd_soc_pcm_runtime *dpcm_get_be(struct snd_soc_card *card, be->cpu_dai->capture_widget ? be->cpu_dai->capture_widget->name : "(not set)"); - if (be->cpu_dai->capture_widget == widget) + if ((be->cpu_dai->capture_widget && + be->cpu_dai->capture_widget == widget && + (be->dai_link->stream_name && + !strcmp(be->dai_link->stream_name, + be->cpu_dai->capture_widget->sname))) || + be->codec_dai->capture_widget == widget) return be; for_each_rtd_codec_dai(be, i, dai) {