提交 681e3692 编写于 作者: A Axel Lin 提交者: Mark Brown

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: NAxel Lin <axel.lin@gmail.com>
Acked-by: NLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 1dcb4f38
......@@ -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;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册