summaryrefslogtreecommitdiff
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorJeffy Chen <jeffy.chen@rock-chips.com>2017-08-24 12:40:17 +0800
committerMark Brown <broonie@kernel.org>2017-08-25 14:49:44 +0100
commit6a6dafda937cfcdbbfe46a3e093de8bb929ba52d (patch)
tree20c95617a086d61120c0493e2199a21993f3ea42 /sound/soc/soc-core.c
parent4958471b0d2110a34df0b45803e6f24ed89b857b (diff)
ASoC: Add a sanity check before using dai driver name
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> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 6fab0ff213ef..74c17068bb11 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;