[PATCH 1/5] powerpc: null pointer check
Dave C Boutcher
sleddog at us.ibm.com
Wed Jan 11 21:00:23 EST 2006
There should never be a device-tree node without a name
property. But if one ever shows up, the panic is not
pretty. Add a quick check to make the name pointer
is not null before we use it.
Signed-off-by: Dave Boutcher <sledog at us.ibm.com>
diff -uNr -X exclude-files linux-2.6.15/arch/powerpc/kernel/prom.c linux-2.6.15-vpm/arch/powerpc/kernel/prom.c
--- linux-2.6.15/arch/powerpc/kernel/prom.c 2006-01-02 21:21:10.000000000 -0600
+++ linux-2.6.15-vpm/arch/powerpc/kernel/prom.c 2006-01-11 00:06:40.000000000 -0600
@@ -613,7 +613,8 @@
if (ip != NULL)
nsizec = *ip;
- if (!strcmp(np->name, "device-tree") || np->parent == NULL)
+ if ((np->name && !strcmp(np->name, "device-tree"))
+ || (np->parent == NULL))
ifunc = interpret_root_props;
else if (np->type == 0)
ifunc = NULL;
--
Dave Boutcher
More information about the Linuxppc64-dev
mailing list