ASoC: pcm030-audio-fabric: fix resource leak in pcm030_fabric_init error path
authorAxel Lin <axel.lin@gmail.com>
Thu, 25 Nov 2010 07:08:31 +0000 (15:08 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 25 Nov 2010 11:08:25 +0000 (11:08 +0000)
Add missing platform_device_put() if platform_device_add() failed.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/fsl/pcm030-audio-fabric.c

index 25f27ec1dd6e4bba2590b869745d575c1d5b3545..ba4d85e317ed459907601b1df426738ddf88ee68 100644 (file)
@@ -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;