summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2015-07-08 22:14:48 +0200
committerMark Brown <broonie@kernel.org>2015-07-08 22:16:51 +0100
commit2210438b6aae9668cf89c272fef935b83aedf81d (patch)
tree68319ea9b5d9c5383618e7431588b0d33cbd70e4 /sound/soc/soc-core.c
parente18077b6e5dfe26e9fbbdc1fd1085a1701c24bea (diff)
downloadlinux-2210438b6aae9668cf89c272fef935b83aedf81d.tar.gz
linux-2210438b6aae9668cf89c272fef935b83aedf81d.tar.bz2
linux-2210438b6aae9668cf89c272fef935b83aedf81d.zip
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 <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c1
1 files changed, 1 insertions, 0 deletions
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);