linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@cs.helsinki.fi>
To: Kulikov Vasiliy <segooon@gmail.com>
Cc: kernel-janitors@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Tejun Heo <tj@kernel.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Nick Piggin <npiggin@suse.de>, Jan Beulich <jbeulich@novell.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 05/10] mm: check kmalloc() return value
Date: Wed, 28 Jul 2010 19:53:06 +0300	[thread overview]
Message-ID: <AANLkTimhz5D4jthc8__HvHekznWSftXqqDihzjKbW9=P@mail.gmail.com> (raw)
In-Reply-To: <1280335203-23305-1-git-send-email-segooon@gmail.com>

On Wed, Jul 28, 2010 at 7:40 PM, Kulikov Vasiliy <segooon@gmail.com> wrote:
> kmalloc() may fail, if so return -ENOMEM.
>
> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>

Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>

> ---
>  mm/vmalloc.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index b7e314b..f63684a 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -2437,8 +2437,11 @@ static int vmalloc_open(struct inode *inode, struct file *file)
>        unsigned int *ptr = NULL;
>        int ret;
>
> -       if (NUMA_BUILD)
> +       if (NUMA_BUILD) {
>                ptr = kmalloc(nr_node_ids * sizeof(unsigned int), GFP_KERNEL);
> +               if (ptr == NULL)
> +                       return -ENOMEM;
> +       }
>        ret = seq_open(file, &vmalloc_op);
>        if (!ret) {
>                struct seq_file *m = file->private_data;
> --
> 1.7.0.4
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2010-07-28 16:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-28 16:40 [PATCH 05/10] mm: check kmalloc() return value Kulikov Vasiliy
2010-07-28 16:53 ` Pekka Enberg [this message]

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='AANLkTimhz5D4jthc8__HvHekznWSftXqqDihzjKbW9=P@mail.gmail.com' \
    --to=penberg@cs.helsinki.fi \
    --cc=akpm@linux-foundation.org \
    --cc=jbeulich@novell.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@suse.de \
    --cc=segooon@gmail.com \
    --cc=tj@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).