From: Lars-Peter Clausen Date: Wed, 8 Jul 2015 20:14:48 +0000 (+0200) Subject: ASoC: Free card DAPM context on snd_soc_instantiate_card() error path X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=2210438b6aae9668cf89c272fef935b83aedf81d;p=openwrt%2Fstaging%2Fblogic.git 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 3a4a5c0e3f97..0e1e69c7abd5 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);