diff options
author | 2011-11-17 12:43:40 +0000 | |
---|---|---|
committer | 2011-12-04 10:46:56 -0800 | |
commit | f0a4cf31017ac8179a2fe295c1bd8e821d7674f4 (patch) | |
tree | 1a640c00647cc7eb90d9849033071270f39f81d7 /arch/sparc/kernel/prom_common.c | |
parent | xen/pm_idle: Make pm_idle be default_idle under Xen. (diff) | |
download | linux-f0a4cf31017ac8179a2fe295c1bd8e821d7674f4.tar.gz linux-f0a4cf31017ac8179a2fe295c1bd8e821d7674f4.tar.bz2 linux-f0a4cf31017ac8179a2fe295c1bd8e821d7674f4.zip |
sparc: Use kmemdup rather than duplicating its implementation
The semantic patch that makes this change is available
in scripts/coccinelle/api/memdup.cocci.
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/prom_common.c')
-rw-r--r-- | arch/sparc/kernel/prom_common.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/sparc/kernel/prom_common.c b/arch/sparc/kernel/prom_common.c index 46614807a57f..741df916c124 100644 --- a/arch/sparc/kernel/prom_common.c +++ b/arch/sparc/kernel/prom_common.c @@ -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); |