[alsa-devel] [PATCH 1/3] ASoC: Fix error handling in e800_init to free gpios

Axel Lin axel.lin at gmail.com
Wed Dec 7 03:01:30 CET 2011


Signed-off-by: Axel Lin <axel.lin at gmail.com>
---
 sound/soc/pxa/e800_wm9712.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/soc/pxa/e800_wm9712.c b/sound/soc/pxa/e800_wm9712.c
index 6a8f38b..26e0232 100644
--- a/sound/soc/pxa/e800_wm9712.c
+++ b/sound/soc/pxa/e800_wm9712.c
@@ -136,8 +136,10 @@ static int __init e800_init(void)
 		goto free_spk_amp_gpio;
 
 	e800_snd_device = platform_device_alloc("soc-audio", -1);
-	if (!e800_snd_device)
-		return -ENOMEM;
+	if (!e800_snd_device) {
+		ret = -ENOMEM;
+		goto free_spk_amp_gpio;
+	}
 
 	platform_set_drvdata(e800_snd_device, &e800);
 	ret = platform_device_add(e800_snd_device);
-- 
1.7.5.4





More information about the Alsa-devel mailing list