From: Axel Lin Date: Mon, 12 Dec 2011 03:26:00 +0000 (+0800) Subject: ASoC: Fix hx4700 error handling to free gpios if snd_soc_register_card fails X-Git-Tag: v3.2~13^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=497d496598f411cb7f0690725a0e8b9029cebdb9;p=platform%2Fkernel%2Flinux-stable.git ASoC: Fix hx4700 error handling to free gpios if snd_soc_register_card fails Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- diff --git a/sound/soc/pxa/hx4700.c b/sound/soc/pxa/hx4700.c index 65c1248..c664e33 100644 --- a/sound/soc/pxa/hx4700.c +++ b/sound/soc/pxa/hx4700.c @@ -209,9 +209,10 @@ static int __devinit hx4700_audio_probe(struct platform_device *pdev) snd_soc_card_hx4700.dev = &pdev->dev; ret = snd_soc_register_card(&snd_soc_card_hx4700); if (ret) - return ret; + gpio_free_array(hx4700_audio_gpios, + ARRAY_SIZE(hx4700_audio_gpios)); - return 0; + return ret; } static int __devexit hx4700_audio_remove(struct platform_device *pdev)