Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60831842 authored by Anton Blanchard's avatar Anton Blanchard Committed by Benjamin Herrenschmidt
Browse files

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: default avatarAnton Blanchard <anton@samba.org>
Cc: stable@kernel.org
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent e377bc5d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;
}