[alsa-devel] [PATCH] ASoC: Free card DAPM context on snd_soc_instantiate_card() error path
Lars-Peter Clausen
lars at metafoo.de
Wed Jul 8 22:14:48 CEST 2015
Make sure the to free the card DAPM context if snd_soc_instantiate_card()
fails, otherwise the memory allocated for the DAPM widgets is leaked.
Signed-off-by: Lars-Peter Clausen <lars at metafoo.de>
---
sound/soc/soc-core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 2fc461c..8c8ce65 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1728,6 +1728,7 @@ card_probe_error:
if (card->remove)
card->remove(card);
+ snd_soc_dapm_free(&card->dapm);
soc_cleanup_card_debugfs(card);
snd_card_free(card->snd_card);
--
2.1.4
More information about the Alsa-devel
mailing list