summaryrefslogtreecommitdiff
path: root/drivers/regulator/of_regulator.c
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2018-01-27 01:13:44 +0300
committerMark Brown <broonie@kernel.org>2018-02-12 15:05:31 +0300
commit30966861a7a2051457be8c49466887d78cc47e97 (patch)
treecd1a14e963fac14c37ebfb33c72db1b921c21fa2 /drivers/regulator/of_regulator.c
parent7928b2cbe55b2a410a0f5c1f154610059c57b1b2 (diff)
downloadlinux-30966861a7a2051457be8c49466887d78cc47e97.tar.xz
regulator: of: Add a missing 'of_node_put()' in an error handling path of 'of_regulator_match()'
If an unlikely failure in 'of_get_regulator_init_data()' occurs, we must release the reference on the current 'child' node before returning. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/of_regulator.c')
-rw-r--r--drivers/regulator/of_regulator.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
index 092ed6efb3ec..f47264fa1940 100644
--- a/drivers/regulator/of_regulator.c
+++ b/drivers/regulator/of_regulator.c
@@ -321,6 +321,7 @@ int of_regulator_match(struct device *dev, struct device_node *node,
dev_err(dev,
"failed to parse DT for regulator %s\n",
child->name);
+ of_node_put(child);
return -EINVAL;
}
match->of_node = of_node_get(child);