powerpc/numa: Remove double of_node_put in hot_add_node_scn_to_nid
commit6083184269fd723affca4f6340e491950267622a
authorAnton Blanchard <anton@samba.org>
Wed, 10 Aug 2011 20:44:21 +0000 (10 20:44 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 20 Sep 2011 05:53:22 +0000 (20 15:53 +1000)
treef852990fe1344af155dc26be41a254a354066747
parente377bc5d49fdbcb5f0e559b644d806a15454d407
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>
arch/powerpc/mm/numa.c