未验证 提交 8a065ce9 编写于 作者: C Christophe JAILLET 提交者: Mark Brown

regulator: Avoid a double 'of_node_get' in 'regulator_of_get_init_node()'

'for_each_available_child_of_node()' already performs an 'of_node_get()'
on child, so there is no need to perform another one before returning.
Otherwise, a double 'get' is performed and a resource may never be
released.

Fixes: 925c85e2 ("regulator: Factor out location of init data OF node")
Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: NCharles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/a79f0068812b89ff412d572a1171f22109c24132.1618947049.git.christophe.jaillet@wanadoo.frSigned-off-by: NMark Brown <broonie@kernel.org>
上级 69b8821e
......@@ -422,7 +422,11 @@ device_node *regulator_of_get_init_node(struct device *dev,
if (!strcmp(desc->of_match, name)) {
of_node_put(search);
return of_node_get(child);
/*
* 'of_node_get(child)' is already performed by the
* for_each loop.
*/
return child;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册