alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: core: Clean up DAPM before the card debugfs
@ 2016-08-18 18:37 Mark Brown
  2016-08-18 23:26 ` Russell King - ARM Linux
  2016-08-19 15:10 ` Applied "ASoC: core: Clean up DAPM before the card debugfs" to the asoc tree Mark Brown
  0 siblings, 2 replies; 8+ messages in thread
From: Mark Brown @ 2016-08-18 18:37 UTC (permalink / raw)
  To: Liam Girdwood, Russell King - ARM Linux; +Cc: alsa-devel, Mark Brown

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>
Signed-off-by: Mark Brown <broonie@kernel.org>
---

Not tested at all yet, just about done for today.

 sound/soc/soc-core.c | 3 +--
 1 file changed, 1 insertion(+), 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)
 	/* 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;
 
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-08-22 13:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-18 18:37 [PATCH] ASoC: core: Clean up DAPM before the card debugfs Mark Brown
2016-08-18 23:26 ` Russell King - ARM Linux
2016-08-19 17:50   ` Mark Brown
2016-08-19 18:04     ` Russell King - ARM Linux
2016-08-19 18:11       ` Mark Brown
2016-08-22 13:30         ` Peter Ujfalusi
2016-08-22 13:32   ` Peter Ujfalusi
2016-08-19 15:10 ` Applied "ASoC: core: Clean up DAPM before the card debugfs" to the asoc tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).