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 <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>
struct nvme_iod *iod = blk_mq_rq_to_pdu(req);
nvme_cleanup_cmd(req);
- nvme_unmap_data(iod->nvmeq->dev, req);
+ if (blk_rq_nr_phys_segments(req))
+ nvme_unmap_data(iod->nvmeq->dev, req);
nvme_complete_rq(req);
}