From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754285AbZFHMyM (ORCPT ); Mon, 8 Jun 2009 08:54:12 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752587AbZFHMx7 (ORCPT ); Mon, 8 Jun 2009 08:53:59 -0400 Received: from mx2.redhat.com ([66.187.237.31]:35697 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751782AbZFHMx7 (ORCPT ); Mon, 8 Jun 2009 08:53:59 -0400 Date: Mon, 8 Jun 2009 08:53:59 -0400 From: Vivek Goyal To: Cyrill Gorcunov Cc: LKML , Alexey Dobriyan Subject: Re: [PATCH] proc: vmcore - use kzalloc in get_new_element Message-ID: <20090608125359.GA3652@redhat.com> References: <20090606171207.GC20807@lenovo> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090606171207.GC20807@lenovo> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 06, 2009 at 09:12:07PM +0400, Cyrill Gorcunov wrote: > Instead of kmalloc+memset better use straight kzalloc > > Signed-off-by: Cyrill Gorcunov > --- > 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) Acked-by: Vivek Goyal Thanks Vivek