]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 11 Nov 2011 17:44:39 +0000 (09:44 -0800)
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

index 2164006fe170f8e0e8a7adddd67e78803872c9e2..2c1ae7a5fb53c79ee09eff79f6a94e07f2cf7f53 100644 (file)
@@ -1214,11 +1214,12 @@ int hot_add_node_scn_to_nid(unsigned long scn_addr)
                        break;
                }
 
-               of_node_put(memory);
                if (nid >= 0)
                        break;
        }
 
+       of_node_put(memory);
+
        return nid;
 }