Skip to content

Commit

Permalink
ASoC: core: Clean up DAPM before the card debugfs
Browse files Browse the repository at this point in the history
Both the card and DAPM cleanups recursively delete their debugfs
directories.  Since the DAPM debugfs subdirectory for the card is
located within the card debugfs this means we end up trying to double
free the DAPM subdirectory.  Reorder the cleanup to free the card
debugfs after we've cleaned up DAPM and it has deleted its own
subdirectory.

Reported-by: Russell King - ARM Linux <linux@armlinux.org.uk>
Tested-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Mark Brown committed Aug 19, 2016
1 parent 29b4817 commit d1e8142
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2083,14 +2083,13 @@ static int soc_cleanup_card_resources(struct snd_soc_card *card)
/* remove auxiliary devices */
soc_remove_aux_devices(card);

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

/* remove the card */
if (card->remove)
card->remove(card);

snd_soc_dapm_free(&card->dapm);

snd_card_free(card->snd_card);
return 0;

Expand Down

0 comments on commit d1e8142

Please sign in to comment.