Skip to content

Commit

Permalink
ASoC: Free card DAPM context on snd_soc_instantiate_card() error path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lars-Peter Clausen authored and Mark Brown committed Jul 8, 2015
1 parent e18077b commit 2210438
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1716,6 +1716,7 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
if (card->remove)
card->remove(card);

snd_soc_dapm_free(&card->dapm);
soc_cleanup_card_debugfs(card);
snd_card_free(card->snd_card);

Expand Down

0 comments on commit 2210438

Please sign in to comment.