diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2013-03-07 20:42:33 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-03-12 14:34:59 -0400 |
commit | e1328a832c7eeeb4dd3c3666605717c555de9e83 (patch) | |
tree | 6c5120e1f62a56f93d0f31d7547798e80c31bc05 /sound/soc | |
parent | 2db6be6a7b3edc8a5acea99b817eb7b9e608e931 (diff) |
ASoC: core: 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.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/soc-core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index e02c374d2243..0ce075c47b25 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -4096,6 +4096,10 @@ int snd_soc_register_codec(struct device *dev, | |||
4096 | return 0; | 4096 | return 0; |
4097 | 4097 | ||
4098 | fail_codec_name: | 4098 | fail_codec_name: |
4099 | mutex_lock(&client_mutex); | ||
4100 | list_del(&codec->list); | ||
4101 | mutex_unlock(&client_mutex); | ||
4102 | |||
4099 | kfree(codec->name); | 4103 | kfree(codec->name); |
4100 | fail_codec: | 4104 | fail_codec: |
4101 | kfree(codec); | 4105 | kfree(codec); |