summaryrefslogtreecommitdiff
path: root/arch/powerpc
diff options
context:
space:
mode:
authorMiaoqian Lin <linmq006@gmail.com>2022-06-05 08:32:23 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-08-25 12:15:25 +0300
commitf658d5b528ce97a68efbb64ee54f6fe0909b189a (patch)
treeb4a3330aa98cf4384e57505fe55c5df8be848db3 /arch/powerpc
parentd0cb99948c5f6d8fe56f6e69b8dd0a05ee5f9cec (diff)
downloadlinux-f658d5b528ce97a68efbb64ee54f6fe0909b189a.tar.xz
powerpc/xive: Fix refcount leak in xive_get_max_prio
[ Upstream commit 255b650cbec6849443ce2e0cdd187fd5e61c218c ] 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 Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/sysdev/xive/spapr.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c
index 5566bbc86f4a..aa705732150c 100644
--- a/arch/powerpc/sysdev/xive/spapr.c
+++ b/arch/powerpc/sysdev/xive/spapr.c
@@ -631,6 +631,7 @@ static bool 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;