Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 681e3692 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown
Browse files

ASoC: Fix resource leak if soc_register_ac97_dai_link failed



Properly free the resources in the case of soc_register_ac97_dai_link failure.

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 1dcb4f38
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -1622,6 +1622,8 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
		ret = soc_register_ac97_dai_link(&card->rtd[i]);
		if (ret < 0) {
			printk(KERN_ERR "asoc: failed to register AC97 %s\n", card->name);
			while (--i >= 0)
				soc_unregister_ac97_dai_link(&card->rtd[i]);
			goto probe_dai_err;
		}
	}