[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20220607033306.688-3-linmq006@gmail.com>
Date: Tue, 7 Jun 2022 07:33:00 +0400
From: Miaoqian Lin <linmq006@...il.com>
To: "David S. Miller" <davem@...emloft.net>,
Miaoqian Lin <linmq006@...il.com>, sparclinux@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/3] sparc: kernel: Fix reference leak in jbusmc_probe
of_find_node_by_path() returns a node pointer with refcount incremented,
we should use of_node_put() on it when not need anymore.
Add missing of_node_put() to avoid refcount leak.
Fixes: 85269eb5542b ("sparc64: Add JBUS UltraSPARC-IIIi support to memory controller driver.")
Signed-off-by: Miaoqian Lin <linmq006@...il.com>
---
arch/sparc/kernel/chmc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/sparc/kernel/chmc.c b/arch/sparc/kernel/chmc.c
index 6ff43df740e0..9cc1b92ffff9 100644
--- a/arch/sparc/kernel/chmc.c
+++ b/arch/sparc/kernel/chmc.c
@@ -409,6 +409,7 @@ static int jbusmc_probe(struct platform_device *op)
goto out;
}
mem_regs = of_get_property(mem_node, "reg", &len);
+ of_node_put(mem_node);
if (!mem_regs) {
printk(KERN_ERR PFX "Cannot get reg property of /memory node.\n");
goto out;
--
2.25.1
Powered by blists - more mailing lists