Skip to content

Commit 9456823

Browse files
TinyWindzzrafaeljw
authored andcommitted
cpuidle: big.LITTLE: fix refcount leak
of_find_node_by_path() acquires a reference to the node returned by it and that reference needs to be dropped by its caller. bl_idle_init() doesn't do that, so fix it. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 61cb575 commit 9456823

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/cpuidle/cpuidle-big_little.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,19 @@ static int __init bl_idle_init(void)
167167
{
168168
int ret;
169169
struct device_node *root = of_find_node_by_path("/");
170+
const struct of_device_id *match_id;
170171

171172
if (!root)
172173
return -ENODEV;
173174

174175
/*
175176
* Initialize the driver just for a compliant set of machines
176177
*/
177-
if (!of_match_node(compatible_machine_match, root))
178+
match_id = of_match_node(compatible_machine_match, root);
179+
180+
of_node_put(root);
181+
182+
if (!match_id)
178183
return -ENODEV;
179184

180185
if (!mcpm_is_available())

0 commit comments

Comments
 (0)