diff options
| author | Keith Busch <kbusch@kernel.org> | 2026-05-19 18:03:44 -0700 |
|---|---|---|
| committer | Keith Busch <kbusch@kernel.org> | 2026-05-21 07:48:58 -0700 |
| commit | 85686c72966c5ee637893f124ddb31a1cace7bee (patch) | |
| tree | 6e6dbbd8e615258ba0e3ef53f517a399ec99e873 | |
| parent | 431e40042d3599559e588b8946bb28bd440b4f65 (diff) | |
nvme-pci: fix dma_vecs leak on p2p memory
We don't unmap P2P memory, so we don't need to track it. The dma_vec
allocation was getting leaked on the completion.
Fixes: b8b7570a7ec87 ("nvme-pci: fix dma unmapping when using PRPs and not using the IOVA mapping")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
| -rw-r--r-- | drivers/nvme/host/pci.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 139a10cd687f..f423f1718439 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -966,7 +966,8 @@ static bool nvme_pci_prp_save_mapping(struct request *req, { struct nvme_iod *iod = blk_mq_rq_to_pdu(req); - if (dma_use_iova(&iod->dma_state) || !dma_need_unmap(dma_dev)) + if (dma_use_iova(&iod->dma_state) || !dma_need_unmap(dma_dev) || + (iod->flags & IOD_DATA_P2P)) return true; if (!iod->nr_dma_vecs) { |
