Commit:     847f5976f90d5637a86a826c1c594091d08f3156
Parent:     c72ea777d4e51435388fbd863c813a19635fa8ef
Author:     Benjamin Herrenschmidt <[EMAIL PROTECTED]>
AuthorDate: Wed May 16 16:57:24 2007 +1000
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Thu May 17 21:11:15 2007 +1000

    [POWERPC] Make sure device node type/name is not NULL on hot-added nodes
    Our device-tree unflattening code makes sure the name and type fields
    of a device-node are not NULL. However, the code for dynamically
    adding devices nodes which is used for pSeries hotplug for example
    didn't do it, potentially causing crashes in some code that assume it
    can always do things like strcmp on those.
    Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
 arch/powerpc/kernel/prom.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index c065b55..066a6a7 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1472,6 +1472,11 @@ static int of_finish_dynamic_node(struct device_node 
        node->name = of_get_property(node, "name", NULL);
        node->type = of_get_property(node, "device_type", NULL);
+       if (!node->name)
+               node->name = "<NULL>";
+       if (!node->type)
+               node->type = "<NULL>";
        if (!parent) {
                err = -ENODEV;
                goto out;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to