diff options
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 614a8b30d87b..441285ade024 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -3043,8 +3043,10 @@ int snd_soc_register_dais(struct device *dev, | |||
3043 | for (i = 0; i < count; i++) { | 3043 | for (i = 0; i < count; i++) { |
3044 | 3044 | ||
3045 | dai = kzalloc(sizeof(struct snd_soc_dai), GFP_KERNEL); | 3045 | dai = kzalloc(sizeof(struct snd_soc_dai), GFP_KERNEL); |
3046 | if (dai == NULL) | 3046 | if (dai == NULL) { |
3047 | return -ENOMEM; | 3047 | ret = -ENOMEM; |
3048 | goto err; | ||
3049 | } | ||
3048 | 3050 | ||
3049 | /* create DAI component name */ | 3051 | /* create DAI component name */ |
3050 | dai->name = fmt_multiple_name(dev, &dai_drv[i]); | 3052 | dai->name = fmt_multiple_name(dev, &dai_drv[i]); |
@@ -3263,9 +3265,6 @@ int snd_soc_register_codec(struct device *dev, | |||
3263 | return 0; | 3265 | return 0; |
3264 | 3266 | ||
3265 | error: | 3267 | error: |
3266 | for (i--; i >= 0; i--) | ||
3267 | snd_soc_unregister_dai(dev); | ||
3268 | |||
3269 | if (codec->reg_cache) | 3268 | if (codec->reg_cache) |
3270 | kfree(codec->reg_cache); | 3269 | kfree(codec->reg_cache); |
3271 | kfree(codec->name); | 3270 | kfree(codec->name); |