]> www.infradead.org Git - users/jedix/linux-maple.git/commit
powerpc/numa: Remove double of_node_put in hot_add_node_scn_to_nid
authorAnton Blanchard <anton@samba.org>
Wed, 10 Aug 2011 20:44:21 +0000 (20:44 +0000)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Thu, 8 Dec 2011 19:18:15 +0000 (11:18 -0800)
commitfccfac6478a984cd0d33494e43d982b91c29daca
tree698a5cc3e7cb886c48609f5fbb3fde6113d04e8a
parent8d327ae7de63ff4cc21555c3b4cc55e6d780dcaf
powerpc/numa: Remove double of_node_put in hot_add_node_scn_to_nid

commit 6083184269fd723affca4f6340e491950267622a upstream.

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>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/powerpc/mm/numa.c