diff options
author | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | 2015-02-20 11:08:44 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-02-21 09:30:30 -0500 |
commit | a7b976ae4bff9ff4f9c9943d3232dec7e87c68b9 (patch) | |
tree | 823648d45b3f9a161f6135bd63a984321e233668 | |
parent | bfa76d49576599a4b9f9b7a71f23d73d6dcff735 (diff) |
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 <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/regulator/arizona-micsupp.c | 5 |
1 files changed, 3 insertions, 2 deletions
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) | |||
284 | micsupp->regulator = devm_regulator_register(&pdev->dev, | 284 | micsupp->regulator = devm_regulator_register(&pdev->dev, |
285 | desc, | 285 | desc, |
286 | &config); | 286 | &config); |
287 | |||
288 | of_node_put(config.of_node); | ||
289 | |||
287 | if (IS_ERR(micsupp->regulator)) { | 290 | if (IS_ERR(micsupp->regulator)) { |
288 | ret = PTR_ERR(micsupp->regulator); | 291 | ret = PTR_ERR(micsupp->regulator); |
289 | dev_err(arizona->dev, "Failed to register mic supply: %d\n", | 292 | dev_err(arizona->dev, "Failed to register mic supply: %d\n", |
@@ -291,8 +294,6 @@ static int arizona_micsupp_probe(struct platform_device *pdev) | |||
291 | return ret; | 294 | return ret; |
292 | } | 295 | } |
293 | 296 | ||
294 | of_node_put(config.of_node); | ||
295 | |||
296 | platform_set_drvdata(pdev, micsupp); | 297 | platform_set_drvdata(pdev, micsupp); |
297 | 298 | ||
298 | return 0; | 299 | return 0; |