[alsa-devel] [PATCH 2/8] ASoC: pcm030-audio-fabric: fix resource leak in pcm030_fabric_init error path

Axel Lin axel.lin at gmail.com
Thu Nov 25 08:08:31 CET 2010


Add missing platform_device_put() if platform_device_add() failed.

Signed-off-by: Axel Lin <axel.lin at gmail.com>
---
 sound/soc/fsl/pcm030-audio-fabric.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/sound/soc/fsl/pcm030-audio-fabric.c b/sound/soc/fsl/pcm030-audio-fabric.c
index 25f27ec..ba4d85e 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;
-- 
1.7.2





More information about the Alsa-devel mailing list