diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2015-08-07 03:59:09 -0400 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2015-08-10 04:26:33 -0400 |
commit | 1ecb40643a9af05683b7a898d7141884bcb28a82 (patch) | |
tree | de53ac640e8170130fe41fc2ec23efc2bce5f094 | |
parent | 519f648e15ccded12e7ce4a26c7959c4ac46b145 (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>
-rw-r--r-- | arch/m68k/kernel/bootinfo_proc.c | 4 |
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) | |||
62 | if (!bootinfo_size) | 62 | if (!bootinfo_size) |
63 | return -EINVAL; | 63 | return -EINVAL; |
64 | 64 | ||
65 | bootinfo_copy = kmalloc(bootinfo_size, GFP_KERNEL); | 65 | bootinfo_copy = kmemdup(bootinfo_tmp, bootinfo_size, GFP_KERNEL); |
66 | if (!bootinfo_copy) | 66 | if (!bootinfo_copy) |
67 | return -ENOMEM; | 67 | return -ENOMEM; |
68 | 68 | ||
69 | memcpy(bootinfo_copy, bootinfo_tmp, bootinfo_size); | ||
70 | |||
71 | pde = proc_create_data("bootinfo", 0400, NULL, &bootinfo_fops, NULL); | 69 | pde = proc_create_data("bootinfo", 0400, NULL, &bootinfo_fops, NULL); |
72 | if (!pde) { | 70 | if (!pde) { |
73 | kfree(bootinfo_copy); | 71 | kfree(bootinfo_copy); |