From: Jeffy Chen Date: Thu, 24 Aug 2017 04:40:17 +0000 (+0800) Subject: ASoC: Add a sanity check before using dai driver name X-Git-Tag: v4.14-rc4~21^2~23^2~18^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6a6dafda937cfcdbbfe46a3e093de8bb929ba52d;p=platform%2Fkernel%2Flinux-exynos.git 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 Reported-by: Donglin Peng Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 6fab0ff..74c1706 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;