linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Alexander Kuleshov <kuleshovmail@gmail.com>
Cc: Tony Luck <tony.luck@intel.com>,
	Pekka Enberg <penberg@kernel.org>, Mel Gorman <mgorman@suse.de>,
	Robin Holt <holt@sgi.com>, Tang Chen <tangchen@cn.fujitsu.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Santosh Shilimkar <santosh.shilimkar@ti.com>
Subject: Re: [PATCH] mm/memblock: check memblock_reserve on fail in memblock_virt_alloc_internal
Date: Mon, 17 Aug 2015 14:59:32 -0700	[thread overview]
Message-ID: <20150817145932.68fe9460c4392a0c3907392a@linux-foundation.org> (raw)
In-Reply-To: <1439663206-15484-1-git-send-email-kuleshovmail@gmail.com>

On Sun, 16 Aug 2015 00:26:46 +0600 Alexander Kuleshov <kuleshovmail@gmail.com> wrote:

> This patch adds a check for memblock_reserve() call in the
> memblock_virt_alloc_internal() function, because memblock_reserve()
> can return -errno on fail.
> 
> ...
>
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -1298,7 +1298,9 @@ again:
>  
>  	return NULL;
>  done:
> -	memblock_reserve(alloc, size);
> +	if (memblock_reserve(alloc, size))
> +		return NULL;
> +
>  	ptr = phys_to_virt(alloc);
>  	memset(ptr, 0, size);

This shouldn't ever happen.  If it *does* happen, something is messed
up and we should warn.  

--
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:[~2015-08-17 21:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-15 18:26 Alexander Kuleshov
2015-08-17 21:59 ` Andrew Morton [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=20150817145932.68fe9460c4392a0c3907392a@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=holt@sgi.com \
    --cc=kuleshovmail@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=penberg@kernel.org \
    --cc=santosh.shilimkar@ti.com \
    --cc=tangchen@cn.fujitsu.com \
    --cc=tony.luck@intel.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