summaryrefslogtreecommitdiff
path: root/arch/m68k
diff options
context:
space:
mode:
authorAndrzej Hajda <a.hajda@samsung.com>2015-08-07 09:59:09 +0200
committerGeert Uytterhoeven <geert@linux-m68k.org>2015-08-10 10:26:33 +0200
commit1ecb40643a9af05683b7a898d7141884bcb28a82 (patch)
treede53ac640e8170130fe41fc2ec23efc2bce5f094 /arch/m68k
parent519f648e15ccded12e7ce4a26c7959c4ac46b145 (diff)
m68k/bootinfo: Use kmemdup rather than duplicating its implementation
The patch was generated using fixed coccinelle semantic patch scripts/coccinelle/api/memdup.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2014320 Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k')
-rw-r--r--arch/m68k/kernel/bootinfo_proc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/m68k/kernel/bootinfo_proc.c b/arch/m68k/kernel/bootinfo_proc.c
index 7ee853e1432b..2a33a9645ad8 100644
--- a/arch/m68k/kernel/bootinfo_proc.c
+++ b/arch/m68k/kernel/bootinfo_proc.c
@@ -62,12 +62,10 @@ static int __init init_bootinfo_procfs(void)
if (!bootinfo_size)
return -EINVAL;
- bootinfo_copy = kmalloc(bootinfo_size, GFP_KERNEL);
+ bootinfo_copy = kmemdup(bootinfo_tmp, bootinfo_size, GFP_KERNEL);
if (!bootinfo_copy)
return -ENOMEM;
- memcpy(bootinfo_copy, bootinfo_tmp, bootinfo_size);
-
pde = proc_create_data("bootinfo", 0400, NULL, &bootinfo_fops, NULL);
if (!pde) {
kfree(bootinfo_copy);