aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2016-08-18 14:32:59 -0400
committerMark Brown <broonie@kernel.org>2016-08-19 05:17:26 -0400
commitd1e81428826221d7ff8e4d83db784d099cd232a7 (patch)
tree83bcd0aa3a4cea80d090bcc7fffc6d7a01387fe2
parent29b4817d4018df78086157ea3a55c1d9424a7cfc (diff)
ASoC: core: Clean up DAPM before the card debugfs
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>
-rw-r--r--sound/soc/soc-core.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 16369cad4803..66a33f1e4881 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2083,14 +2083,13 @@ static int soc_cleanup_card_resources(struct snd_soc_card *card)
2083 /* remove auxiliary devices */ 2083 /* remove auxiliary devices */
2084 soc_remove_aux_devices(card); 2084 soc_remove_aux_devices(card);
2085 2085
2086 snd_soc_dapm_free(&card->dapm);
2086 soc_cleanup_card_debugfs(card); 2087 soc_cleanup_card_debugfs(card);
2087 2088
2088 /* remove the card */ 2089 /* remove the card */
2089 if (card->remove) 2090 if (card->remove)
2090 card->remove(card); 2091 card->remove(card);
2091 2092
2092 snd_soc_dapm_free(&card->dapm);
2093
2094 snd_card_free(card->snd_card); 2093 snd_card_free(card->snd_card);
2095 return 0; 2094 return 0;
2096 2095