From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: linux-kernel@vger.kernel.org
Cc: fengguang.wu@intel.com, Yuanhan Liu <yuanhan.liu@linux.intel.com>,
Matthew Wilcox <matthew.r.wilcox@intel.com>,
Keith Busch <keith.busch@intel.com>
Subject: [PATCH] NVMe: check the return of nvme_alloc_iod
Date: Thu, 18 Oct 2012 18:43:20 +0800 [thread overview]
Message-ID: <1350557000-18825-1-git-send-email-yuanhan.liu@linux.intel.com> (raw)
It maybe failed due to out of memory.
Cc: Matthew Wilcox <matthew.r.wilcox@intel.com>
Cc: Keith Busch <keith.busch@intel.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
---
drivers/block/nvme.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/block/nvme.c b/drivers/block/nvme.c
index 931769e..eb58978 100644
--- a/drivers/block/nvme.c
+++ b/drivers/block/nvme.c
@@ -1091,6 +1091,10 @@ static struct nvme_iod *nvme_map_user_pages(struct nvme_dev *dev, int write,
}
iod = nvme_alloc_iod(count, length, GFP_KERNEL);
+ if (!iod) {
+ err = -ENOMEM;
+ goto put_pages;
+ }
sg = iod->sg;
sg_init_table(sg, count);
for (i = 0; i < count; i++) {
--
1.7.7.6
reply other threads:[~2012-10-18 10:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1350557000-18825-1-git-send-email-yuanhan.liu@linux.intel.com \
--to=yuanhan.liu@linux.intel.com \
--cc=fengguang.wu@intel.com \
--cc=keith.busch@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew.r.wilcox@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
all inboxes | Powered by JetHome®