Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/xive: Fix refcount leak in xive_get_max_prio

of_find_node_by_path() returns a node pointer with
refcount incremented, we should use of_node_put() on it when done.
Add missing of_node_put() to avoid refcount leak.

Fixes: eac1e731b59e ("powerpc/xive: guest exploitation of the XIVE interrupt controller")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220605053225.56125-1-linmq006@gmail.com

authored by

Miaoqian Lin and committed by
Michael Ellerman
255b650c 6ac059da

+1
+1
arch/powerpc/sysdev/xive/spapr.c
··· 718 718 } 719 719 720 720 reg = of_get_property(rootdn, "ibm,plat-res-int-priorities", &len); 721 + of_node_put(rootdn); 721 722 if (!reg) { 722 723 pr_err("Failed to read 'ibm,plat-res-int-priorities' property\n"); 723 724 return false;