]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
ASoC: soc-core: dai_link check under soc_dpcm_debugfs_add()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Wed, 7 Aug 2019 01:31:36 +0000 (10:31 +0900)
committerMark Brown <broonie@kernel.org>
Thu, 8 Aug 2019 19:56:58 +0000 (20:56 +0100)
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>
sound/soc/soc-core.c
sound/soc/soc-pcm.c

index 2a75fba31aa4a85be1486b8159f2dbf0c44467da..1fbd525763d5f9cf5a650e980a68ee9d3813813e 100644 (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;
 
index 77c986fe08d0f7672c7e541c08fce92f68e8c4b2..da657c8179cc1f8f1cc5a50bf5536c6120190178 100644 (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;