From: Axel Lin Date: Wed, 7 Dec 2011 02:01:30 +0000 (+0800) Subject: ASoC: Fix error handling in e800_init to free gpios X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8faab941bec7af1c1865db316ac2f37c78071271;p=linux-beck.git ASoC: Fix error handling in e800_init to free gpios Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- diff --git a/sound/soc/pxa/e800_wm9712.c b/sound/soc/pxa/e800_wm9712.c index 6a8f38b6c379..26e02322f10b 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);