Commit 2f6d3110 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Linus Torvalds

proc: vmcore - use kzalloc in get_new_element()

Instead of kmalloc+memset better use straight kzalloc
Signed-off-by: default avatarCyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: default avatarWANG Cong <xiyou.wangcong@gmail.com>
Acked-by: default avatarVivek Goyal <vgoyal@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent bcac2b1b
...@@ -166,12 +166,7 @@ static const struct file_operations proc_vmcore_operations = { ...@@ -166,12 +166,7 @@ static const struct file_operations proc_vmcore_operations = {
static struct vmcore* __init get_new_element(void) static struct vmcore* __init get_new_element(void)
{ {
struct vmcore *p; return kzalloc(sizeof(struct vmcore), GFP_KERNEL);
p = kmalloc(sizeof(*p), GFP_KERNEL);
if (p)
memset(p, 0, sizeof(*p));
return p;
} }
static u64 __init get_vmcore_size_elf64(char *elfptr) static u64 __init get_vmcore_size_elf64(char *elfptr)
......
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