From 68b8eca5f882230e4991df0db0a3094f49420a90 Mon Sep 17 00:00:00 2001 From: Keith Busch Date: Wed, 1 May 2013 13:07:47 -0600 Subject: 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 Signed-off-by: Matthew Wilcox --- drivers/block/nvme-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/block') diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c index 391a874e413..388c54d8480 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); -- cgit v1.2.3-70-g09d2