Thread (5 messages) flat view 5 messages, 2 authors, 2006-02-07

Re: [PATCH] missing refcounting of of_find_node_by_name users

From: Paul Mackerras <hidden>
Date: 2006-02-07 10:49:49

Olaf Hering writes:
drop the refcount of the node returned from of_find_node_by_name
[snip]
quoted hunk ↗ jump to hunk
--- linux-2.6.16-rc2-olh.orig/arch/powerpc/platforms/powermac/feature.c
+++ linux-2.6.16-rc2-olh/arch/powerpc/platforms/powermac/feature.c
@@ -2772,6 +2772,7 @@ set_initial_features(void)
 				g5_gmac_enable(np, 0, 1);
 			np = of_find_node_by_name(np, "ethernet");
 		}
+		of_node_put(np);
This one isn't necessary, since np is NULL by the time we get out of
the loop.  Same applies to the other places in this file that this
patch affects.
quoted hunk ↗ jump to hunk
Index: linux-2.6.16-rc2-olh/arch/powerpc/platforms/powermac/pci.c
===================================================================
--- linux-2.6.16-rc2-olh.orig/arch/powerpc/platforms/powermac/pci.c
+++ linux-2.6.16-rc2-olh/arch/powerpc/platforms/powermac/pci.c
@@ -695,6 +695,7 @@ static void __init fixup_nec_usb2(void)
 				nec->intrs[0].line);
 		}
 	}
+	of_put_node(nec);
Once again, nec is NULL by the time we get here.  And of_put_node
doesn't exist. :(  Did you compile-test this?

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