[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220615145448.3969508-1-windhl@126.com>
Date: Wed, 15 Jun 2022 22:54:48 +0800
From: Liang He <windhl@....com>
To: linux@...linux.org.uk, shawnguo@...nel.org, s.hauer@...gutronix.de,
kernel@...gutronix.de, festevam@...il.com, linux-imx@....com
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
windhl@....com
Subject: [PATCH] arm: mach-imx: Add missing of_node_put() in cpu-imx31.c
In mx31_read_cpu_rev(), of_find_compatible_node() 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/arm/mach-imx/cpu-imx31.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm/mach-imx/cpu-imx31.c b/arch/arm/mach-imx/cpu-imx31.c
index b9c24b851d1a..cff6be524626 100644
--- a/arch/arm/mach-imx/cpu-imx31.c
+++ b/arch/arm/mach-imx/cpu-imx31.c
@@ -39,6 +39,9 @@ static int mx31_read_cpu_rev(void)
np = of_find_compatible_node(NULL, NULL, "fsl,imx31-iim");
iim_base = of_iomap(np, 0);
+
+ of_node_put(np);
+
BUG_ON(!iim_base);
/* read SREV register from IIM module */
--
2.25.1
Powered by blists - more mailing lists