mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-04-14 13:57:32 +07:00
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: Axel Lin <axel.lin@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
1dcb4f38e5
commit
681e369247
@ -1619,12 +1619,14 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
|
|||||||
#ifdef CONFIG_SND_SOC_AC97_BUS
|
#ifdef CONFIG_SND_SOC_AC97_BUS
|
||||||
/* register any AC97 codecs */
|
/* register any AC97 codecs */
|
||||||
for (i = 0; i < card->num_rtd; i++) {
|
for (i = 0; i < card->num_rtd; i++) {
|
||||||
ret = soc_register_ac97_dai_link(&card->rtd[i]);
|
ret = soc_register_ac97_dai_link(&card->rtd[i]);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
printk(KERN_ERR "asoc: failed to register AC97 %s\n", card->name);
|
printk(KERN_ERR "asoc: failed to register AC97 %s\n", card->name);
|
||||||
goto probe_dai_err;
|
while (--i >= 0)
|
||||||
}
|
soc_unregister_ac97_dai_link(&card->rtd[i]);
|
||||||
|
goto probe_dai_err;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
card->instantiated = 1;
|
card->instantiated = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user