From: Axel Lin Date: Thu, 25 Nov 2010 07:08:31 +0000 (+0800) Subject: ASoC: pcm030-audio-fabric: fix resource leak in pcm030_fabric_init error path X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=917dac0ff1754776b86967b0ec1750022d9c4265;p=openwrt%2Fstaging%2Fblogic.git ASoC: pcm030-audio-fabric: fix resource leak in pcm030_fabric_init error path Add missing platform_device_put() if platform_device_add() failed. Signed-off-by: Axel Lin Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- diff --git a/sound/soc/fsl/pcm030-audio-fabric.c b/sound/soc/fsl/pcm030-audio-fabric.c index 25f27ec1dd6e..ba4d85e317ed 100644 --- a/sound/soc/fsl/pcm030-audio-fabric.c +++ b/sound/soc/fsl/pcm030-audio-fabric.c @@ -76,6 +76,7 @@ static __init int pcm030_fabric_init(void) rc = platform_device_add(pdev); if (rc) { pr_err("pcm030_fabric_init: platform_device_add() failed\n"); + platform_device_put(pdev); return -ENODEV; } return 0;