From: Keith Busch <keith.busch@intel.com>
To: Nicholas Krause <xerofoify@gmail.com>
Cc: willy@linux.intel.com, linux-kernel@vger.kernel.org,
linux-nvme@lists.infradead.org
Subject: Re: [PATCH] block:Change the function, nvme_alloc_queue to use -ENOMEM for when failing memory allocations
Date: Wed, 13 May 2015 14:12:10 +0000 (UTC) [thread overview]
Message-ID: <alpine.LNX.2.00.1505131408540.15930@localhost.lm.intel.com> (raw)
In-Reply-To: <1431474691-30469-1-git-send-email-xerofoify@gmail.com>
On Tue, 12 May 2015, Nicholas Krause wrote:
> This changes the function,nvme_alloc_queue to use the kernel code,
> -ENOMEM for when failing to allocate the memory required for the
> nvme_queue structure pointer,nvme in order to correctly return
> to the caller the correct reason for this function's failing.
Nak! Look at what the callers are checking for upon return.
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
> drivers/block/nvme-core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
> index 85b8036..e2eac1e 100644
> --- a/drivers/block/nvme-core.c
> +++ b/drivers/block/nvme-core.c
> @@ -1387,7 +1387,7 @@ static struct nvme_queue *nvme_alloc_queue(struct nvme_dev *dev, int qid,
> struct device *dmadev = &dev->pci_dev->dev;
> struct nvme_queue *nvmeq = kzalloc(sizeof(*nvmeq), GFP_KERNEL);
> if (!nvmeq)
> - return NULL;
> + return -ENOMEM;
>
> nvmeq->cqes = dma_zalloc_coherent(dmadev, CQ_SIZE(depth),
> &nvmeq->cq_dma_addr, GFP_KERNEL);
prev parent reply other threads:[~2015-05-13 14:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1431474691-30469-1-git-send-email-xerofoify@gmail.com>
2015-05-13 13:32 ` [PATCH] block:Change the function,nvme_alloc_queue to use -ENOMEM for when failing memory allocations Matthew Wilcox
2015-05-13 14:12 ` Keith Busch [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=alpine.LNX.2.00.1505131408540.15930@localhost.lm.intel.com \
--to=keith.busch@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=willy@linux.intel.com \
--cc=xerofoify@gmail.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