diff options
author | Anton Blanchard <anton@samba.org> | 2011-08-10 16:44:21 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-09-20 01:53:22 -0400 |
commit | 6083184269fd723affca4f6340e491950267622a (patch) | |
tree | f852990fe1344af155dc26be41a254a354066747 /arch/powerpc/mm | |
parent | e377bc5d49fdbcb5f0e559b644d806a15454d407 (diff) |
powerpc/numa: Remove double of_node_put in hot_add_node_scn_to_nid
During memory hotplug testing, I got the following warning:
ERROR: Bad of_node_put() on /memory@0
of_node_release
kref_put
of_node_put
of_find_node_by_type
hot_add_node_scn_to_nid
hot_add_scn_to_nid
memory_add_physaddr_to_nid
...
of_find_node_by_type() loop does the of_node_put for us so we only
need the handle the case where we terminate the loop early.
As suggested by Stephen Rothwell we can do the of_node_put
unconditionally outside of the loop since of_node_put handles a
NULL argument fine.
Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: stable@kernel.org
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r-- | arch/powerpc/mm/numa.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 2164006fe170..2c1ae7a5fb53 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -1214,11 +1214,12 @@ int hot_add_node_scn_to_nid(unsigned long scn_addr) | |||
1214 | break; | 1214 | break; |
1215 | } | 1215 | } |
1216 | 1216 | ||
1217 | of_node_put(memory); | ||
1218 | if (nid >= 0) | 1217 | if (nid >= 0) |
1219 | break; | 1218 | break; |
1220 | } | 1219 | } |
1221 | 1220 | ||
1221 | of_node_put(memory); | ||
1222 | |||
1222 | return nid; | 1223 | return nid; |
1223 | } | 1224 | } |
1224 | 1225 | ||