From: Christophe JAILLET Date: Fri, 26 Jan 2018 22:13:44 +0000 (+0100) Subject: regulator: of: Add a missing 'of_node_put()' in an error handling path of 'of_regulat... X-Git-Tag: v4.14.45~5 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=bd1a6e338c1b644c52b1d6196f43cca87334a399;p=users%2Fdwmw2%2Flinux.git regulator: of: Add a missing 'of_node_put()' in an error handling path of 'of_regulator_match()' [ Upstream commit 30966861a7a2051457be8c49466887d78cc47e97 ] 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 Signed-off-by: Mark Brown Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c index 14637a01ba2d3..c9875355905d1 100644 --- a/drivers/regulator/of_regulator.c +++ b/drivers/regulator/of_regulator.c @@ -305,6 +305,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);