regulator: arizona-ldo1: Drop OF node reference on error path
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Fri, 20 Feb 2015 16:08:43 +0000 (16:08 +0000)
committerMark Brown <broonie@kernel.org>
Sat, 21 Feb 2015 14:30:02 +0000 (23:30 +0900)
We were not calling of_node_put if the regulator failed to register this
patch fixes this.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/arizona-ldo1.c

index 8169165904c0c67f0c04089121dee074bc8f49fa..a1d07d347c20e30af065d204d94a314d18c408e3 100644 (file)
@@ -282,6 +282,9 @@ static int arizona_ldo1_probe(struct platform_device *pdev)
                arizona->external_dcvdd = true;
 
        ldo1->regulator = devm_regulator_register(&pdev->dev, desc, &config);
+
+       of_node_put(config.of_node);
+
        if (IS_ERR(ldo1->regulator)) {
                ret = PTR_ERR(ldo1->regulator);
                dev_err(arizona->dev, "Failed to register LDO1 supply: %d\n",
@@ -289,8 +292,6 @@ static int arizona_ldo1_probe(struct platform_device *pdev)
                return ret;
        }
 
-       of_node_put(config.of_node);
-
        platform_set_drvdata(pdev, ldo1);
 
        return 0;
This page took 0.025407 seconds and 5 git commands to generate.