]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] ppc64: always initialise dn->type and dn->name
authorAnton Blanchard <anton@samba.org>
Thu, 15 Apr 2004 23:53:12 +0000 (16:53 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 15 Apr 2004 23:53:12 +0000 (16:53 -0700)
This fix comes from ppc32. Always initialise dn->type and dn->name so
that code doesnt have to check for NULL everywhere. There is at least
one bug report where we oopsed because of this.

arch/ppc64/kernel/prom.c

index 6748b2244e88d1b8528bd41a497b3cb631298046..ed31f6ef6b61567ec13cbe90a247204dd37ced98 100644 (file)
@@ -1926,6 +1926,11 @@ finish_node(struct device_node *np, unsigned long mem_start,
        np->name = get_property(np, "name", 0);
        np->type = get_property(np, "device_type", 0);
 
+       if (!np->name)
+               np->name = "<NULL>";
+       if (!np->type)
+               np->type = "<NULL>";
+
        /* get the device addresses and interrupts */
        if (ifunc != NULL)
                mem_start = ifunc(np, mem_start, naddrc, nsizec);