ASoC: Free card DAPM context on snd_soc_instantiate_card() error path
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 8 Jul 2015 20:14:48 +0000 (22:14 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 8 Jul 2015 21:16:51 +0000 (22:16 +0100)
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>
sound/soc/soc-core.c

index 3a4a5c0..0e1e69c 100644 (file)
@@ -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);