Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -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)