Skip to content

Commit 255b650

Browse files
Yuuoniympe
authored andcommitted
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: eac1e73 ("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
1 parent 6ac059d commit 255b650

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/powerpc/sysdev/xive/spapr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,7 @@ static bool __init xive_get_max_prio(u8 *max_prio)
718718
}
719719

720720
reg = of_get_property(rootdn, "ibm,plat-res-int-priorities", &len);
721+
of_node_put(rootdn);
721722
if (!reg) {
722723
pr_err("Failed to read 'ibm,plat-res-int-priorities' property\n");
723724
return false;

0 commit comments

Comments
 (0)