Commit 6a6dafda authored by Jeffy Chen's avatar Jeffy Chen Committed by Mark Brown

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: default avatarJeffy Chen <jeffy.chen@rock-chips.com>
Reported-by: default avatarDonglin Peng <dolinux.peng@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 4958471b
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment