mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Amerigo Wang <xiyou.wangcong@gmail.com>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Vivek Goyal <vgoyal@redhat.com>
Subject: Re: [PATCH] proc: vmcore - use kzalloc in get_new_element
Date: Mon, 8 Jun 2009 09:50:18 +0800	[thread overview]
Message-ID: <20090608015018.GA2596@cr0.nay.redhat.com> (raw)
In-Reply-To: <20090606171207.GC20807@lenovo>

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 <gorcunov@openvz.org>

Looks good!

Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>


>---
> 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)
>--
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/

  reply	other threads:[~2009-06-08  1:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-06 17:12 Cyrill Gorcunov
2009-06-08  1:50 ` Amerigo Wang [this message]
2009-06-08 12:53 ` Vivek Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090608015018.GA2596@cr0.nay.redhat.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=adobriyan@gmail.com \
    --cc=gorcunov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vgoyal@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®