summaryrefslogtreecommitdiff
path: root/drivers/block/nvme-core.c
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2013-05-01 23:07:47 +0400
committerMatthew Wilcox <matthew.r.wilcox@intel.com>2013-05-02 22:34:35 +0400
commit68b8eca5f882230e4991df0db0a3094f49420a90 (patch)
tree1ab6b77745c27962368da4daac8e8fd1820ce722 /drivers/block/nvme-core.c
parent025c557a71bd06a9f6d32259f00e2218b15bf0a4 (diff)
downloadlinux-68b8eca5f882230e4991df0db0a3094f49420a90.tar.xz
NVMe: Fix error clean-up on nvme_alloc_queue
The nvme_queue's depth is not set if we fail to allocate submission queue entries, which was being used to determine how much coherent memory to free on error. Use the depth variable instead. Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Diffstat (limited to 'drivers/block/nvme-core.c')
-rw-r--r--drivers/block/nvme-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
index 391a874e4133..388c54d84809 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -956,7 +956,7 @@ static struct nvme_queue *nvme_alloc_queue(struct nvme_dev *dev, int qid,
return nvmeq;
free_cqdma:
- dma_free_coherent(dmadev, CQ_SIZE(nvmeq->q_depth), (void *)nvmeq->cqes,
+ dma_free_coherent(dmadev, CQ_SIZE(depth), (void *)nvmeq->cqes,
nvmeq->cq_dma_addr);
free_nvmeq:
kfree(nvmeq);