public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ASoC: Add a sanity check before using dai driver name
@ 2017-08-24  3:34 Jeffy Chen
  2017-08-24  3:46 ` Donglin Peng
  2017-08-26 14:13 ` kbuild test robot
  0 siblings, 2 replies; 11+ messages in thread
From: Jeffy Chen @ 2017-08-24  3:34 UTC (permalink / raw)
  To: linux-kernel, broonie
  Cc: tiwai, dolinux.peng, Jeffy Chen, Jaroslav Kysela, alsa-devel,
	Takashi Iwai, Liam Girdwood

The dai driver's name is allowed to be NULL. So add a sanity check for
that.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Reported-by: Donglin Peng <dolinux.peng@gmail.com>
---

Changes in v2:
Keep the oringinal check style.

 sound/soc/soc-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index fc1bb2da3e2e..c38c8f844546 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1029,7 +1029,8 @@ struct snd_soc_dai *snd_soc_find_dai(
 			continue;
 		list_for_each_entry(dai, &component->dai_list, list) {
 			if (dlc->dai_name && strcmp(dai->name, dlc->dai_name)
-			    && strcmp(dai->driver->name, dlc->dai_name))
+			    && (!dai->driver->name
+				|| !strcmp(dai->driver->name, dlc->dai_name))
 				continue;
 
 			return dai;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-08-28  1:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-24  3:34 [PATCH v2] ASoC: Add a sanity check before using dai driver name Jeffy Chen
2017-08-24  3:46 ` Donglin Peng
2017-08-24  4:44   ` jeffy
2017-08-26 14:13 ` kbuild test robot
2017-08-26 15:09   ` Donglin Peng
2017-08-27 12:19     ` Mark Brown
2017-08-27 13:54       ` Donglin Peng
2017-08-27 14:26         ` Mark Brown
     [not found]         ` <c8fut2564q2ilhtdm8q39a40.1503844312370@email.android.com>
2017-08-27 14:34           ` Mark Brown
2017-08-27 22:21             ` jeffy
2017-08-28  1:47           ` Donglin Peng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox