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 <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
Axel Lin 2010-11-25 15:08:31 +08:00 committed by Mark Brown
parent 4e1f865097
commit 917dac0ff1

View 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;