Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

proc: vmcore - use kzalloc in get_new_element()

Instead of kmalloc+memset better use straight kzalloc

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Cyrill Gorcunov and committed by
Linus Torvalds
2f6d3110 bcac2b1b

+1 -6
+1 -6
fs/proc/vmcore.c
··· 166 166 167 167 static struct vmcore* __init get_new_element(void) 168 168 { 169 - struct vmcore *p; 170 - 171 - p = kmalloc(sizeof(*p), GFP_KERNEL); 172 - if (p) 173 - memset(p, 0, sizeof(*p)); 174 - return p; 169 + return kzalloc(sizeof(struct vmcore), GFP_KERNEL); 175 170 } 176 171 177 172 static u64 __init get_vmcore_size_elf64(char *elfptr)