Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec454d70 authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown
Browse files

regulator: arizona-ldo1: Drop OF node reference on error path



We were not calling of_node_put if the regulator failed to register this
patch fixes this.

Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent bfa76d49
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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;