diff mbox series

[4/5] ARM: imx35: add missing of_node_put()

Message ID 20221206171049.3316611-5-dario.binacchi@amarulasolutions.com
State New
Headers show
Series ARM: imx: add missing of_node_put() | expand

Commit Message

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

Fixes: f68ea682d1da7 ("ARM: imx35: Retrieve the IIM base address from devicetree")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---

 arch/arm/mach-imx/cpu-imx35.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/arch/arm/mach-imx/cpu-imx35.c b/arch/arm/mach-imx/cpu-imx35.c
index 80e7d8ab9f1b..1fe75b39c2d9 100644
--- a/arch/arm/mach-imx/cpu-imx35.c
+++ b/arch/arm/mach-imx/cpu-imx35.c
@@ -21,6 +21,7 @@  static int mx35_read_cpu_rev(void)
 
 	np = of_find_compatible_node(NULL, NULL, "fsl,imx35-iim");
 	iim_base = of_iomap(np, 0);
+	of_node_put(np);
 	BUG_ON(!iim_base);
 
 	rev = imx_readl(iim_base + MXC_IIMSREV);