[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220421110347.4304-1-linmq006@gmail.com>
Date: Thu, 21 Apr 2022 19:03:44 +0800
From: Miaoqian Lin <linmq006@...il.com>
To: Russell King <linux@...linux.org.uk>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
NXP Linux Team <linux-imx@....com>,
Miaoqian Lin <linmq006@...il.com>,
Arnd Bergmann <arnd@...db.de>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH] ARM: imx35: Fix refcount leak in mx35_read_cpu_rev
The of_find_compatible_node() function returns a node pointer with
refcount incremented, We should use of_node_put() on it when done
Add the missing of_node_put() to release the refcount.
Fixes: f68ea682d1da ("ARM: imx35: Retrieve the IIM base address from devicetree")
Signed-off-by: Miaoqian Lin <linmq006@...il.com>
---
arch/arm/mach-imx/cpu-imx35.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-imx/cpu-imx35.c b/arch/arm/mach-imx/cpu-imx35.c
index 80e7d8ab9f1b..3ae4a3dc44fb 100644
--- a/arch/arm/mach-imx/cpu-imx35.c
+++ b/arch/arm/mach-imx/cpu-imx35.c
@@ -22,6 +22,7 @@ static int mx35_read_cpu_rev(void)
np = of_find_compatible_node(NULL, NULL, "fsl,imx35-iim");
iim_base = of_iomap(np, 0);
BUG_ON(!iim_base);
+ of_node_put(np);
rev = imx_readl(iim_base + MXC_IIMSREV);
switch (rev) {
--
2.17.1
Powered by blists - more mailing lists