DORMANTno replies

[PATCH] powerpc/chrp: Add missing of_node_get() before of_find_node_by_name()

From: Zhang Zekun <hidden>
Date: 2024-10-24 03:13:20
Subsystem: linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Linus Torvalds

of_find_node_by_name() will decrease the refount of the device_node.
So, get the device_node before passing to it.

Signed-off-by: Zhang Zekun <redacted>
---
 arch/powerpc/platforms/chrp/pci.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c
index 428fd2a7b3ee..57dd0f19ada5 100644
--- a/arch/powerpc/platforms/chrp/pci.c
+++ b/arch/powerpc/platforms/chrp/pci.c
@@ -191,6 +191,7 @@ static void __init setup_peg2(struct pci_controller *hose, struct device_node *d
 	struct device_node *root = of_find_node_by_path("/");
 	struct device_node *rtas;
 
+	of_node_get(root);
 	rtas = of_find_node_by_name (root, "rtas");
 	if (rtas) {
 		hose->ops = &rtas_pci_ops;
-- 
2.17.1

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help