1 From da3173d3058200129d97a32efdd40ae33eb8d9a8 Mon Sep 17 00:00:00 2001
2 From: Yangtao Li <tiny.windzz@gmail.com>
3 Date: Mon, 10 Dec 2018 11:26:41 -0500
4 Subject: cpuidle: big.LITTLE: fix refcount leak
6 [ Upstream commit 9456823c842f346c74265fcd98d008d87a7eb6f5 ]
8 of_find_node_by_path() acquires a reference to the node
9 returned by it and that reference needs to be dropped by its caller.
10 bl_idle_init() doesn't do that, so fix it.
12 Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
13 Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
14 Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
15 Signed-off-by: Sasha Levin <sashal@kernel.org>
17 drivers/cpuidle/cpuidle-big_little.c | 7 ++++++-
18 1 file changed, 6 insertions(+), 1 deletion(-)
20 diff --git a/drivers/cpuidle/cpuidle-big_little.c b/drivers/cpuidle/cpuidle-big_little.c
21 index db2ede565f1a..b44476a1b7ad 100644
22 --- a/drivers/cpuidle/cpuidle-big_little.c
23 +++ b/drivers/cpuidle/cpuidle-big_little.c
24 @@ -167,6 +167,7 @@ static int __init bl_idle_init(void)
27 struct device_node *root = of_find_node_by_path("/");
28 + const struct of_device_id *match_id;
32 @@ -174,7 +175,11 @@ static int __init bl_idle_init(void)
34 * Initialize the driver just for a compliant set of machines
36 - if (!of_match_node(compatible_machine_match, root))
37 + match_id = of_match_node(compatible_machine_match, root);
44 if (!mcpm_is_available())