提交 2f6d3110 编写于 作者: C Cyrill Gorcunov 提交者: Linus Torvalds

proc: vmcore - use kzalloc in get_new_element()

Instead of kmalloc+memset better use straight kzalloc
Signed-off-by: NCyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: NWANG Cong <xiyou.wangcong@gmail.com>
Acked-by: NVivek Goyal <vgoyal@redhat.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 bcac2b1b
......@@ -166,12 +166,7 @@ static const struct file_operations proc_vmcore_operations = {
static struct vmcore* __init get_new_element(void)
{
struct vmcore *p;
p = kmalloc(sizeof(*p), GFP_KERNEL);
if (p)
memset(p, 0, sizeof(*p));
return p;
return kzalloc(sizeof(struct vmcore), GFP_KERNEL);
}
static u64 __init get_vmcore_size_elf64(char *elfptr)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册