All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv3 1/2] nvme-pci: fix dma_vecs leak on p2p memory
@ 2026-05-20 17:49 Keith Busch
  2026-05-20 17:49 ` [PATCHv3 2/2] nvme-pci: fix dma mapping leak on data setup error Keith Busch
  2026-05-21  8:21 ` [PATCHv3 1/2] nvme-pci: fix dma_vecs leak on p2p memory Christoph Hellwig
  0 siblings, 2 replies; 5+ messages in thread
From: Keith Busch @ 2026-05-20 17:49 UTC (permalink / raw)
  To: linux-nvme, hch; +Cc: Keith Busch

From: Keith Busch <kbusch@kernel.org>

We don't unmap P2P memory, so allocating the dma_vec for it was being
leaked on completion.

Fixes: b8b7570a7ec87 ("nvme-pci: fix dma unmapping when using PRPs and not using the IOVA mapping")
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
 drivers/nvme/host/pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 139a10cd687f9..744b388eea956 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) {
-- 
2.53.0-Meta



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-05-21 14:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-20 17:49 [PATCHv3 1/2] nvme-pci: fix dma_vecs leak on p2p memory Keith Busch
2026-05-20 17:49 ` [PATCHv3 2/2] nvme-pci: fix dma mapping leak on data setup error Keith Busch
2026-05-21  8:23   ` Christoph Hellwig
2026-05-21  8:21 ` [PATCHv3 1/2] nvme-pci: fix dma_vecs leak on p2p memory Christoph Hellwig
2026-05-21 14:47   ` Keith Busch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.