Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [alsa-devel] [PATCH] ASoC: core: delete component->card_list in soc_remove_component only
@ 2019-09-16 21:03 Bard liao
  2019-09-17 14:33 ` Pierre-Louis Bossart
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Bard liao @ 2019-09-16 21:03 UTC (permalink / raw)
  To: broonie, tiwai
  Cc: alsa-devel, bard.liao, pierre-louis.bossart, kuninori.morimoto.gx

From: Bard Liao <yung-chuan.liao@linux.intel.com>

We add component->card_list in the end of soc_probe_component(). In
other words, component->card_list will not be added if there is an
error in the soc_probe_component() function. So we can't delete
component->card_list in the error handling of soc_probe_component().

Fixes: 22d1423187e5 ("ASoC: soc-core: add soc_cleanup_component()")
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
---
 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 35f48e9c5ead..aff4b4bf4d07 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -978,7 +978,6 @@ static void soc_cleanup_component(struct snd_soc_component *component)
 	/* For framework level robustness */
 	snd_soc_component_set_jack(component, NULL, NULL);
 
-	list_del(&component->card_list);
 	snd_soc_dapm_free(snd_soc_component_get_dapm(component));
 	soc_cleanup_component_debugfs(component);
 	component->card = NULL;
@@ -991,7 +990,7 @@ static void soc_remove_component(struct snd_soc_component *component)
 		return;
 
 	snd_soc_component_remove(component);
-
+	list_del(&component->card_list);
 	soc_cleanup_component(component);
 }
 
-- 
2.17.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

end of thread, other threads:[~2019-09-18 23:52 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-16 21:03 [alsa-devel] [PATCH] ASoC: core: delete component->card_list in soc_remove_component only Bard liao
2019-09-17 14:33 ` Pierre-Louis Bossart
2019-09-17 16:02 ` [alsa-devel] Applied "ASoC: core: delete component->card_list in soc_remove_component only" to the asoc tree Mark Brown
2019-09-18  0:51 ` [alsa-devel] [PATCH] ASoC: core: delete component->card_list in soc_remove_component only Kuninori Morimoto
2019-09-18  2:47   ` Liao, Bard
2019-09-18  4:06     ` Kuninori Morimoto
2019-09-18  5:27       ` Liao, Bard
2019-09-18  5:46         ` Kuninori Morimoto
2019-09-18  6:13           ` Liao, Bard
2019-09-18 12:07             ` Mark Brown
2019-09-18 12:31               ` Liao, Bard
2019-09-18 12:53                 ` Mark Brown
2019-09-18 23:50                   ` Kuninori Morimoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox