]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
48a162c9f3ae7801f60224254878dfd4578776a5
[thirdparty/kernel/stable-queue.git] /
1 From foo@baz Sun May 27 17:33:38 CEST 2018
2 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
3 Date: Fri, 26 Jan 2018 23:13:44 +0100
4 Subject: regulator: of: Add a missing 'of_node_put()' in an error handling path of 'of_regulator_match()'
5
6 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
7
8 [ Upstream commit 30966861a7a2051457be8c49466887d78cc47e97 ]
9
10 If an unlikely failure in 'of_get_regulator_init_data()' occurs, we must
11 release the reference on the current 'child' node before returning.
12
13 Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
14 Signed-off-by: Mark Brown <broonie@kernel.org>
15 Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
16 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17 ---
18 drivers/regulator/of_regulator.c | 1 +
19 1 file changed, 1 insertion(+)
20
21 --- a/drivers/regulator/of_regulator.c
22 +++ b/drivers/regulator/of_regulator.c
23 @@ -282,6 +282,7 @@ int of_regulator_match(struct device *de
24 dev_err(dev,
25 "failed to parse DT for regulator %s\n",
26 child->name);
27 + of_node_put(child);
28 return -EINVAL;
29 }
30 match->of_node = of_node_get(child);