]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.9.30/of-fix-cpus-reference-leak-in-of_numa_parse_cpu_nodes.patch
Linux 4.14.95
[thirdparty/kernel/stable-queue.git] / releases / 4.9.30 / of-fix-cpus-reference-leak-in-of_numa_parse_cpu_nodes.patch
1 From b8475cbee5ab2eac05f9cd5dbcc94c453d3cbf10 Mon Sep 17 00:00:00 2001
2 From: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
3 Date: Mon, 17 Apr 2017 20:29:17 -0400
4 Subject: of: fix "/cpus" reference leak in of_numa_parse_cpu_nodes()
5
6 From: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
7
8 commit b8475cbee5ab2eac05f9cd5dbcc94c453d3cbf10 upstream.
9
10 The call to of_find_node_by_path("/cpus") returns the cpus device_node
11 with its reference count incremented. There is no matching of_node_put()
12 call in of_numa_parse_cpu_nodes() which results in a leaked reference
13 to the "/cpus" node.
14
15 This patch adds an of_node_put() to release the reference.
16
17 fixes: 298535c00a2c ("of, numa: Add NUMA of binding implementation.")
18 Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
19 Acked-by: David Daney <david.daney@cavium.com>
20 Signed-off-by: Rob Herring <robh@kernel.org>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22
23 ---
24 drivers/of/of_numa.c | 2 ++
25 1 file changed, 2 insertions(+)
26
27 --- a/drivers/of/of_numa.c
28 +++ b/drivers/of/of_numa.c
29 @@ -57,6 +57,8 @@ static void __init of_numa_parse_cpu_nod
30 else
31 node_set(nid, numa_nodes_parsed);
32 }
33 +
34 + of_node_put(cpus);
35 }
36
37 static int __init of_numa_parse_memory_nodes(void)