summaryrefslogtreecommitdiff
path: root/arch/sparc/kernel/prom_common.c
diff options
context:
space:
mode:
authorThomas Meyer <thomas@m3y3r.de>2011-11-17 12:43:40 +0000
committerDavid S. Miller <davem@davemloft.net>2011-12-04 10:46:56 -0800
commitf0a4cf31017ac8179a2fe295c1bd8e821d7674f4 (patch)
tree1a640c00647cc7eb90d9849033071270f39f81d7 /arch/sparc/kernel/prom_common.c
parente5fd47bfab2df0c2184cc0bf4245d8e1bb7724fb (diff)
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.c4
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);