ASoC: soc.h: return error if multi platform at snd_soc_fixup_dai_links_platform_name()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 22 Mar 2021 02:48:54 +0000 (11:48 +0900)
committerMark Brown <broonie@kernel.org>
Thu, 25 Mar 2021 13:58:54 +0000 (13:58 +0000)
snd_soc_fixup_dai_links_platform_name() is assuming it is single platform.
return error if multi platforms.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/871rc7aoo9.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc.h

index 200815c..e746da9 100644 (file)
@@ -1280,6 +1280,10 @@ int snd_soc_fixup_dai_links_platform_name(struct snd_soc_card *card,
 
        /* set platform name for each dailink */
        for_each_card_prelinks(card, i, dai_link) {
+               /* only single platform is supported for now */
+               if (dai_link->num_platforms != 1)
+                       return -EINVAL;
+
                if (!dai_link->platforms)
                        return -EINVAL;