From: Michael Ellerman Date: Tue, 27 Nov 2018 08:16:44 +0000 (+1100) Subject: powerpc/pseries: Fix node leak in update_lmb_associativity_index() X-Git-Tag: v4.19.88~142 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b7ef6f3c6f041b4e011d2656501d0e9a6d88794f;p=thirdparty%2Fkernel%2Fstable.git powerpc/pseries: Fix node leak in update_lmb_associativity_index() [ Upstream commit 47918bc68b7427e961035949cc1501a864578a69 ] In update_lmb_associativity_index() we lookup dr_node using of_find_node_by_path() which takes a reference for us. In the non-error case we forget to drop the reference. Note that find_aa_index() does modify properties of the node, but doesn't need an extra reference held once it's returned. Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c index d93ff494e7781..7f86bc3eaadec 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c @@ -202,6 +202,7 @@ static int update_lmb_associativity_index(struct drmem_lmb *lmb) aa_index = find_aa_index(dr_node, ala_prop, lmb_assoc); + of_node_put(dr_node); dlpar_free_cc_nodes(lmb_node); if (aa_index < 0) {