Browse Source

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>
Lars-Peter Clausen 10 years ago
parent
commit
2210438b6a
1 changed files with 1 additions and 0 deletions
  1. 1 0
      sound/soc/soc-core.c

+ 1 - 0
sound/soc/soc-core.c

@@ -1716,6 +1716,7 @@ card_probe_error:
 	if (card->remove)
 	if (card->remove)
 		card->remove(card);
 		card->remove(card);
 
 
+	snd_soc_dapm_free(&card->dapm);
 	soc_cleanup_card_debugfs(card);
 	soc_cleanup_card_debugfs(card);
 	snd_card_free(card->snd_card);
 	snd_card_free(card->snd_card);