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…
Reference in New Issue