Skip to content

Commit

Permalink
powerpc/xive: Fix refcount leak in xive_get_max_prio
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Miaoqian Lin authored and Michael Ellerman committed Aug 1, 2022
1 parent 6ac059d commit 255b650
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/powerpc/sysdev/xive/spapr.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ static bool __init xive_get_max_prio(u8 *max_prio)
}

reg = of_get_property(rootdn, "ibm,plat-res-int-priorities", &len);
of_node_put(rootdn);
if (!reg) {
pr_err("Failed to read 'ibm,plat-res-int-priorities' property\n");
return false;
Expand Down

0 comments on commit 255b650

Please sign in to comment.