[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <AANLkTimhz5D4jthc8__HvHekznWSftXqqDihzjKbW9=P@mail.gmail.com>
Date: Wed, 28 Jul 2010 19:53:06 +0300
From: Pekka Enberg <penberg@...helsinki.fi>
To: Kulikov Vasiliy <segooon@...il.com>
Cc: kernel-janitors@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Tejun Heo <tj@...nel.org>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
Nick Piggin <npiggin@...e.de>,
Jan Beulich <jbeulich@...ell.com>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH 05/10] mm: check kmalloc() return value
On Wed, Jul 28, 2010 at 7:40 PM, Kulikov Vasiliy <segooon@...il.com> wrote:
> kmalloc() may fail, if so return -ENOMEM.
>
> Signed-off-by: Kulikov Vasiliy <segooon@...il.com>
Acked-by: Pekka Enberg <penberg@...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@...ck.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@...ck.org"> email@...ck.org </a>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists