Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
[pandora-kernel.git] / arch / powerpc / platforms / pseries / dlpar.c
index 72d8054..b74a923 100644 (file)
@@ -33,7 +33,7 @@ struct cc_workarea {
        u32     prop_offset;
 };
 
-static void dlpar_free_cc_property(struct property *prop)
+void dlpar_free_cc_property(struct property *prop)
 {
        kfree(prop->name);
        kfree(prop->value);
@@ -55,13 +55,12 @@ static struct property *dlpar_parse_cc_property(struct cc_workarea *ccwa)
 
        prop->length = ccwa->prop_length;
        value = (char *)ccwa + ccwa->prop_offset;
-       prop->value = kzalloc(prop->length, GFP_KERNEL);
+       prop->value = kmemdup(value, prop->length, GFP_KERNEL);
        if (!prop->value) {
                dlpar_free_cc_property(prop);
                return NULL;
        }
 
-       memcpy(prop->value, value, prop->length);
        return prop;
 }
 
@@ -102,7 +101,7 @@ static void dlpar_free_one_cc_node(struct device_node *dn)
        kfree(dn);
 }
 
-static void dlpar_free_cc_nodes(struct device_node *dn)
+void dlpar_free_cc_nodes(struct device_node *dn)
 {
        if (dn->child)
                dlpar_free_cc_nodes(dn->child);