Merge branches 'perf-urgent-for-linus' and 'sched-urgent-for-linus' of git://git...
[pandora-kernel.git] / arch / sparc / kernel / prom_common.c
index 4661480..741df91 100644 (file)
@@ -58,12 +58,10 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
        void *new_val;
        int err;
 
-       new_val = kmalloc(len, GFP_KERNEL);
+       new_val = kmemdup(val, len, GFP_KERNEL);
        if (!new_val)
                return -ENOMEM;
 
-       memcpy(new_val, val, len);
-
        err = -ENODEV;
 
        mutex_lock(&of_set_property_mutex);