Skip to content

Commit

Permalink
nvme-pci: move the call to nvme_cleanup_cmd out of nvme_unmap_data
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig committed Apr 5, 2019
1 parent 9b04811 commit 915f04c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/nvme/host/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 915f04c

Please sign in to comment.