Skip to contentSkip to conversation

ARM: versatile: Add missing of_node_put in dcscb_init

PATCH In review Peng Wu 2 participants 2 messages Apr 25, 2022 – Apr 28, 2022

Subsystems (4)
lore
Share & tools
lore

Peng Wu

author
#0 lore raw

PATCH 1/1 ARM: versatile: Add missing of_node_put in dcscb_init

The device_node pointer is returned by of_find_compatible_node with refcount incremented. We should use of_node_put() to avoid the refcount leak.

---
 arch/arm/mach-versatile/dcscb.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-versatile/dcscb.c +1 -0
index 866270e7f271..d8797350996d 100644
@@ -144,6 +144,7 @@ static int __init dcscb_init(void)
 	if (!node)
 		return -ENODEV;
 	dcscb_base = of_iomap(node, 0);
+	of_node_put(node);
 	if (!dcscb_base)
 		return -EADDRNOTAVAIL;
 	cfg = readl_relaxed(dcscb_base + DCS_CFG_R);
Signature · 7 lines
2.17.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#1 lore raw
Quoted 5 lines · Peng Wu

The device_node pointer is returned by of_find_compatible_node with refcount incremented. We should use of_node_put() to avoid the refcount leak.

I applied this on linux-next. signed off and sent directly to the SoC tree.

Yours,
Linus Walleij