mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-17 18:56:24 +00:00
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>
This commit is contained in:
parent
4958471b0d
commit
6a6dafda93
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user