[PATCH 5/5] ARM: imx5: add missing of_node_put()

From: Dario Binacchi
Date: Tue Dec 06 2022 - 12:11:39 EST


In imx5_read_srev_reg(), of_find_compatible_node() returns a node pointer
with refcount incremented. Use of_node_put() on it when done.

Fixes: ee18a7154ee08 ("ARM: imx5: retrieve iim base from device tree")
Signed-off-by: Dario Binacchi <dario.binacchi@xxxxxxxxxxxxxxxxxxxx>

---

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

diff --git a/arch/arm/mach-imx/cpu-imx5.c b/arch/arm/mach-imx/cpu-imx5.c
index ad56263778f9..a67c89bf155d 100644
--- a/arch/arm/mach-imx/cpu-imx5.c
+++ b/arch/arm/mach-imx/cpu-imx5.c
@@ -28,6 +28,7 @@ static u32 imx5_read_srev_reg(const char *compat)

np = of_find_compatible_node(NULL, NULL, compat);
iim_base = of_iomap(np, 0);
+ of_node_put(np);
WARN_ON(!iim_base);

srev = readl(iim_base + IIM_SREV) & 0xff;
--
2.32.0