Skip to content

Commit b15c592

Browse files
author
Christoph Hellwig
committed
nvme-pci: only call nvme_unmap_data for requests transferring data
This mirrors how nvme_map_pci is called and will allow simplifying some checks in nvme_unmap_pci later on. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Keith Busch <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]>
1 parent 7fe07d1 commit b15c592

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/nvme/host/pci.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,8 @@ static void nvme_pci_complete_rq(struct request *req)
929929
struct nvme_iod *iod = blk_mq_rq_to_pdu(req);
930930

931931
nvme_cleanup_cmd(req);
932-
nvme_unmap_data(iod->nvmeq->dev, req);
932+
if (blk_rq_nr_phys_segments(req))
933+
nvme_unmap_data(iod->nvmeq->dev, req);
933934
nvme_complete_rq(req);
934935
}
935936

0 commit comments

Comments
 (0)