summaryrefslogtreecommitdiff
path: root/drivers/nvme/host/pci.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-03-03 08:13:03 -0700
committerChristoph Hellwig <hch@lst.de>2019-04-05 08:07:57 +0200
commit915f04c93db4e3a7388c8ad8ddfc28830e4cbce3 (patch)
tree4ef3a86718e353a3d26a3a976cc2309db3c8651c /drivers/nvme/host/pci.c
parent9b048119a153590b934ef49aae309b723587f527 (diff)
nvme-pci: move the call to nvme_cleanup_cmd out of nvme_unmap_data
Cleaning up the command setup isn't related to unmapping data, and disentangling them will simplify error handling a bit down the road. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Keith Busch <keith.busch@intel.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Diffstat (limited to 'drivers/nvme/host/pci.c')
-rw-r--r--drivers/nvme/host/pci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 2102a107e09b..2af6cfbd77ec 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -888,7 +888,6 @@ static void nvme_unmap_data(struct nvme_dev *dev, struct request *req)
dma_unmap_sg(dev->dev, &iod->meta_sg, 1, dma_dir);
}
- nvme_cleanup_cmd(req);
nvme_free_iod(dev, req);
}
@@ -939,6 +938,7 @@ static void nvme_pci_complete_rq(struct request *req)
{
struct nvme_iod *iod = blk_mq_rq_to_pdu(req);
+ nvme_cleanup_cmd(req);
nvme_unmap_data(iod->nvmeq->dev, req);
nvme_complete_rq(req);
}