Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1718802

[PATCH v2] ASoC: Add a sanity check before using dai driver name

From Jeffy Chen <jeffy.chen@rock-chips.com>
Newsgroups linux.kernel
Subject [PATCH v2] ASoC: Add a sanity check before using dai driver name
Date 2017-08-24 05:40 +0200
Message-ID <uhR9T-113-5@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH v2] ASoC: Add a sanity check before using dai driver name Jeffy Chen <jeffy.chen@rock-chips.com> - 2017-08-24 05:40 +0200
  Re: [PATCH v2] ASoC: Add a sanity check before using dai driver name Donglin Peng <dolinux.peng@gmail.com> - 2017-08-24 05:50 +0200
    Re: [PATCH v2] ASoC: Add a sanity check before using dai driver name jeffy <jeffy.chen@rock-chips.com> - 2017-08-24 06:50 +0200

csiph-web