From: Charles Keepax Date: Fri, 20 Feb 2015 16:08:44 +0000 (+0000) Subject: regulator: arizona-micsupp: Drop OF node reference on error path X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a7b976ae4bff9ff4f9c9943d3232dec7e87c68b9;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git regulator: arizona-micsupp: 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: Charles Keepax Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/arizona-micsupp.c b/drivers/regulator/arizona-micsupp.c index 20079006459a..4116e74effa4 100644 --- a/drivers/regulator/arizona-micsupp.c +++ b/drivers/regulator/arizona-micsupp.c @@ -284,6 +284,9 @@ static int arizona_micsupp_probe(struct platform_device *pdev) micsupp->regulator = devm_regulator_register(&pdev->dev, desc, &config); + + of_node_put(config.of_node); + if (IS_ERR(micsupp->regulator)) { ret = PTR_ERR(micsupp->regulator); dev_err(arizona->dev, "Failed to register mic supply: %d\n", @@ -291,8 +294,6 @@ static int arizona_micsupp_probe(struct platform_device *pdev) return ret; } - of_node_put(config.of_node); - platform_set_drvdata(pdev, micsupp); return 0;