lkml.org 
[lkml]   [2009]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] proc: vmcore - use kzalloc in get_new_element
Instead of kmalloc+memset better use straight kzalloc

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
---
fs/proc/vmcore.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

Index: linux-2.6.git/fs/proc/vmcore.c
=====================================================================
--- linux-2.6.git.orig/fs/proc/vmcore.c
+++ linux-2.6.git/fs/proc/vmcore.c
@@ -166,12 +166,7 @@ static const struct file_operations proc

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)

\
 
 \ /
  Last update: 2009-06-06 19:15    [W:0.046 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site