Skip to contentSkip to conversation

ARM: mxs: Fix refcount leak in mxs_get_ocotp

PATCH New Miaoqian Lin 1 participant 1 message May 12, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: mxs: Fix refcount leak in mxs_get_ocotp

of_find_compatible_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak.

Fixes 1bff2d76ac88 ("ARM: mxs: move mxs_get_ocotp() into mach-mxs.c")
---
 arch/arm/mach-mxs/mach-mxs.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-mxs/mach-mxs.c +1 -0
index 25c9d184fa4c..4af4c3dcfa85 100644
@@ -99,6 +99,7 @@ static const u32 *mxs_get_ocotp(void)
 	np = of_find_compatible_node(NULL, NULL, "fsl,ocotp");
 	ocotp_base = of_iomap(np, 0);
 	WARN_ON(!ocotp_base);
+	of_node_put(np);
 
 	mutex_lock(&ocotp_mutex);
 
Signature · 7 lines
2.25.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel