]> git.hungrycats.org Git - linux/commitdiff
regulator: of: Add a missing 'of_node_put()' in an error handling path of 'of_regulat...
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 26 Jan 2018 22:13:44 +0000 (23:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 May 2018 05:47:45 +0000 (07:47 +0200)
[ 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 <christophe.jaillet@wanadoo.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/regulator/of_regulator.c

index 5a1d4afa4776231e457f5606e0a53c514477b510..87621db13cb77e4c86cdac669149c34386d9b0e0 100644 (file)
@@ -181,6 +181,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);