[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220618015637.4055531-1-windhl@126.com>
Date: Sat, 18 Jun 2022 09:56:37 +0800
From: Liang He <windhl@....com>
To: mpe@...erman.id.au, benh@...nel.crashing.org, paulus@...ba.org,
npiggin@...il.com, clg@...d.org, haren@...ux.ibm.com,
christophe.leroy@...roup.eu
Cc: windhl@....com, linuxppc-dev@...ts.ozlabs.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] powerpc: powernv: opal-core: Fix refcount leak bug
In create_opalcore(), of_find_node_by_name() will return a node
pointer with refcount incremented. We should use of_node_put()
when it is not used anymore.
Signed-off-by: Liang He <windhl@....com>
---
arch/powerpc/platforms/powernv/opal-core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/platforms/powernv/opal-core.c b/arch/powerpc/platforms/powernv/opal-core.c
index adcb1a1a2bfe..bb7657115f1d 100644
--- a/arch/powerpc/platforms/powernv/opal-core.c
+++ b/arch/powerpc/platforms/powernv/opal-core.c
@@ -348,6 +348,8 @@ static int __init create_opalcore(void)
if (!dn || ret)
pr_warn("WARNING: Failed to read OPAL base & entry values\n");
+ of_node_put(dn);
+
/* Use count to keep track of the program headers */
count = 0;
--
2.25.1
Powered by blists - more mailing lists