ASoC: soc-core: dai_link check under soc_dpcm_debugfs_add()

soc_dpcm_debugfs_add(rtd) is checking rtd->dai_link pointer,
but, rtd->dai_link->dynamic have been already checked before calling it.

	static int soc_probe_link_dais(...) {
		dai_link = rtd->dai_link;
		...
=>		if (dai_link->dynamic)
=>			soc_dpcm_debugfs_add(rtd);
		...
	}

	void soc_dpcm_debugfs_add(rtd)
	{
=>		if (!rtd->dai_link)
			return;
		...
	}

These pointer checks are strange/pointless.
This patch checks dai_link->dynamic under soc_dpcm_debugfs_add().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/874l2tahnq.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Kuninori Morimoto 2019-08-07 10:31:36 +09:00 committed by Mark Brown
parent ee5b3f1141
commit 596becd3f8
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
2 changed files with 4 additions and 2 deletions

View File

@ -1488,8 +1488,7 @@ static int soc_probe_link_dais(struct snd_soc_card *card,
return ret;
/* add DPCM sysfs entries */
if (dai_link->dynamic)
soc_dpcm_debugfs_add(rtd);
soc_dpcm_debugfs_add(rtd);
num = rtd->num;

View File

@ -3200,6 +3200,9 @@ void soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd)
if (!rtd->dai_link)
return;
if (!rtd->dai_link->dynamic)
return;
if (!rtd->card->debugfs_card_root)
return;