alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH] ASoC: remove codec from list if registration failed
@ 2013-03-08  1:42 Kuninori Morimoto
  2013-03-12 18:38 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Kuninori Morimoto @ 2013-03-08  1:42 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Simon, Liam Girdwood, Kuninori Morimoto

Current snd_soc_register_codec() adds codec to list, and calls
snd_soc_register_dais().
But, this listed codec should be removed if dais registration
was failed.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---

If my understanding is correct...

 sound/soc/soc-core.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 1ac96df..38d6182 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -4097,6 +4097,10 @@ int snd_soc_register_codec(struct device *dev,
 	return 0;
 
 fail_codec_name:
+	mutex_lock(&client_mutex);
+	list_del(&codec->list);
+	mutex_unlock(&client_mutex);
+
 	kfree(codec->name);
 fail_codec:
 	kfree(codec);
-- 
1.7.9.5

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

end of thread, other threads:[~2013-03-12 18:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-08  1:42 [RFC][PATCH] ASoC: remove codec from list if registration failed Kuninori Morimoto
2013-03-12 18:38 ` 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).