Skip to content
Unverified Commit 4a50724e authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown
Browse files

ASoC: soc.h: fixup return timing for snd_soc_fixup_dai_links_platform_name()



Current snd_soc_fixup_dai_links_platform_name() creates name first (A),
and checks setup target pointer (B), and set it (C).
We should check target pointer first IMO.
This patch exchange the order to (B) -> (A) -> (C).

	int snd_soc_fixup_dai_links_platform_name(...)
	{
		...
		/* set platform name for each dailink */
		for_each_card_prelinks(card, i, dai_link) {
(A)			name = devm_kstrdup(...);
			if (!name)
				return -ENOMEM;

(B)			if (!dai_link->platforms)
				return -EINVAL;

			/* only single platform is supported for now */
(C)			dai_link->platforms->name = name;
		}

		return 0;
	}

Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/8735wnaoon.wl-kuninori.morimoto.gx@renesas.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 4da40cb9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment