Skip to contentSkip to conversation

ASoC: remove codec from list if registration failed

RFC PATCH Applied Kuninori Morimoto 2 participants 2 messages Mar 8, 2013 – Mar 12, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 ASoC: remove codec from list if registration failed

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.

---

If my understanding is correct...

 sound/soc/soc-core.c |    4 ++++
 1 file changed, 4 insertions(+)
sound/soc/soc-core.c +4 -0
index 1ac96df..38d6182 100644
@@ -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);
Signature · 1 line
1.7.9.5
Applied
#1 lore raw
Quoted 4 lines · 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.

Applied, thanks.