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 3a4a5c0e3f9737c795f74367b04c9825462651f8..0e1e69c7abd56b25fab6e4ffb0eab5fd574d03d2 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);