Commit 1ecb4064 authored by Andrzej Hajda's avatar Andrzej Hajda Committed by Geert Uytterhoeven

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/2014320Signed-off-by: default avatarAndrzej Hajda <a.hajda@samsung.com>
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
parent 519f648e
...@@ -62,12 +62,10 @@ static int __init init_bootinfo_procfs(void) ...@@ -62,12 +62,10 @@ static int __init init_bootinfo_procfs(void)
if (!bootinfo_size) if (!bootinfo_size)
return -EINVAL; return -EINVAL;
bootinfo_copy = kmalloc(bootinfo_size, GFP_KERNEL); bootinfo_copy = kmemdup(bootinfo_tmp, bootinfo_size, GFP_KERNEL);
if (!bootinfo_copy) if (!bootinfo_copy)
return -ENOMEM; return -ENOMEM;
memcpy(bootinfo_copy, bootinfo_tmp, bootinfo_size);
pde = proc_create_data("bootinfo", 0400, NULL, &bootinfo_fops, NULL); pde = proc_create_data("bootinfo", 0400, NULL, &bootinfo_fops, NULL);
if (!pde) { if (!pde) {
kfree(bootinfo_copy); kfree(bootinfo_copy);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment