Parcourir la source

ASoC: efika-audio-fabric: fix resource leak in efika_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>
Axel Lin il y a 14 ans
Parent
commit
4e1f865097
1 fichiers modifiés avec 1 ajouts et 0 suppressions
  1. 1 0
      sound/soc/fsl/efika-audio-fabric.c

+ 1 - 0
sound/soc/fsl/efika-audio-fabric.c

@@ -76,6 +76,7 @@ static __init int efika_fabric_init(void)
 	rc = platform_device_add(pdev);
 	if (rc) {
 		pr_err("efika_fabric_init: platform_device_add() failed\n");
+		platform_device_put(pdev);
 		return -ENODEV;
 	}
 	return 0;