public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Matias Bjørling" <m@bjorling.me>
To: Javier Gonzalez <javier@javigon.com>
Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org
Subject: Re: [PATCH] lightnvm: add check after mempool allocation
Date: Tue, 15 Dec 2015 13:11:08 +0100	[thread overview]
Message-ID: <5670035C.7000004@bjorling.me> (raw)
In-Reply-To: <1450181195-24702-1-git-send-email-javier@javigon.com>

On 12/15/2015 01:06 PM, Javier Gonzalez wrote:
> Add missing check after mempool allocation.
>
> Signed-off-by: Javier Gonzalez <javier@cnexlabs.com>
> ---
>   drivers/lightnvm/rrpc.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c
> index a1e7488..f4bc986 100644
> --- a/drivers/lightnvm/rrpc.c
> +++ b/drivers/lightnvm/rrpc.c
> @@ -287,6 +287,8 @@ static int rrpc_move_valid_pages(struct rrpc *rrpc, struct rrpc_block *rblk)
>   	}
>
>   	page = mempool_alloc(rrpc->page_pool, GFP_NOIO);
> +	if (!page)
> +		return -ENOMEM;
>
>   	while ((slot = find_first_zero_bit(rblk->invalid_pages,
>   					    nr_pgs_per_blk)) < nr_pgs_per_blk) {
>
Thanks Javier, applied for 4.5.

      reply	other threads:[~2015-12-15 12:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-15 12:06 [PATCH] lightnvm: add check after mempool allocation Javier Gonzalez
2015-12-15 12:11 ` Matias Bjørling [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=5670035C.7000004@bjorling.me \
    --to=m@bjorling.me \
    --cc=javier@javigon.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.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