From 2210438b6aae9668cf89c272fef935b83aedf81d Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Wed, 8 Jul 2015 22:14:48 +0200 Subject: ASoC: Free card DAPM context on snd_soc_instantiate_card() error path 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 Signed-off-by: Mark Brown diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 3a4a5c0..0e1e69c 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1716,6 +1716,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); -- cgit v0.10.2