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>
This commit is contained in:
		
					parent
					
						
							
								bcac2b1b7d
							
						
					
				
			
			
				commit
				
					
						2f6d311080
					
				
			
		
					 1 changed files with 1 additions and 6 deletions
				
			
		| 
						 | 
					@ -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)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue