[1/5] ARM: imx25: add missing of_node_put()

Message ID 20221206171049.3316611-2-dario.binacchi@amarulasolutions.com
State New
Headers show
Series
  • ARM: imx: add missing of_node_put()
Related show

Commit Message

Dario Binacchi Dec. 6, 2022, 5:10 p.m. UTC
In mx25_read_cpu_rev(), of_find_compatible_node() returns a node pointer
with refcount incremented. Use of_node_put() on it when done.

Fixes: 8b88f7ef31dde ("ARM: mx25: Retrieve IIM base from dt")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---

 arch/arm/mach-imx/cpu-imx25.c | 1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/arch/arm/mach-imx/cpu-imx25.c b/arch/arm/mach-imx/cpu-imx25.c
index 3e63445cde06..cc86977d0a34 100644
--- a/arch/arm/mach-imx/cpu-imx25.c
+++ b/arch/arm/mach-imx/cpu-imx25.c
@@ -23,6 +23,7 @@  static int mx25_read_cpu_rev(void)
 
 	np = of_find_compatible_node(NULL, NULL, "fsl,imx25-iim");
 	iim_base = of_iomap(np, 0);
+	of_node_put(np);
 	BUG_ON(!iim_base);
 	rev = readl(iim_base + MXC_IIMSREV);
 	iounmap(iim_base);