summaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2013-05-01 13:07:48 -0600
committerMatthew Wilcox <matthew.r.wilcox@intel.com>2013-05-02 14:35:44 -0400
commita9ef4343afbe67a6abf83c0f0294e80db48e513a (patch)
treee52c81acc633a2fe0a2ec630368aef91a297a532 /drivers/block
parent68b8eca5f882230e4991df0db0a3094f49420a90 (diff)
NVMe: Check for NULL memory in nvme_dev_add
Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/nvme-core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
index 388c54d8480..2d4f2ae36d3 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -1527,6 +1527,8 @@ static int nvme_dev_add(struct nvme_dev *dev)
mem = dma_alloc_coherent(&dev->pci_dev->dev, 8192, &dma_addr,
GFP_KERNEL);
+ if (!mem)
+ return -ENOMEM;
res = nvme_identify(dev, 0, 1, dma_addr);
if (res) {