linux/drivers/nvme/host
Keith Busch 1bf86336e4 nvme-pci: fix dma mapping leak on data setup error
We're leaking the initial DMA mapping during iteration if we fail to
allocate the tracking descriptor for both PRP and SGL. Unmap the
iterator directly; we can't use the existing unmap helper because it
depends on the tracking descriptor being successfully allocated, so a
new one for an in-use iterator is provided.

The mappings were also leaking when the driver detects an invalid
bio_vec when mapping PRPs, so fix that too.

Fixes: b8b7570a7e ("nvme-pci: fix dma unmapping when using PRPs and not using the IOVA mapping")
Fixes: 7ce3c1dd78 ("nvme-pci: convert the data mapping to blk_rq_dma_map")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
2026-05-21 07:49:05 -07:00
..
apple.c nvme-apple: Reset q->sq_tail during queue init 2026-05-14 07:40:35 -07:00
auth.c nvme-auth: Hash DH shared secret to create session key 2026-04-22 13:02:16 -07:00
constants.c nvme: fix typo in status code constant for self-test in progress 2025-07-17 13:38:07 +02:00
core.c nvme: fix race condition between connected uevent and STARTED_ONCE flag 2026-05-11 10:07:20 -07:00
fabrics.c block-7.0-20260305 2026-03-06 08:36:18 -08:00
fabrics.h nvme: remove virtual boundary for sgl capable devices 2025-11-06 18:11:58 -07:00
fault_inject.c fault-inject: improve build for CONFIG_FAULT_INJECTION=n 2024-09-01 20:43:33 -07:00
fc.c nvme: add missing MODULE_ALIAS for fabrics transports 2026-04-08 08:12:45 -07:00
fc.h nvme-fc: Update header and host for common definitions for LS handling 2020-05-09 16:18:33 -06:00
hwmon.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ioctl.c nvme: fix bio leak on mapping failure 2026-05-11 08:07:39 -07:00
Kconfig block-6.16-20250606 2025-06-06 13:12:50 -07:00
Makefile nvme: rework NVME_AUTH Kconfig selection 2023-10-12 08:04:49 -07:00
multipath.c nvme-multipath: drop head pointer check in nvme_mpath_clear_current_path() 2026-04-09 07:20:39 -07:00
nvme.h nvme: add from0based() helper 2026-03-27 07:35:04 -07:00
pci.c nvme-pci: fix dma mapping leak on data setup error 2026-05-21 07:49:05 -07:00
pr.c nvme: fix memory allocation in nvme_pr_read_keys() 2026-03-04 06:53:41 -08:00
rdma.c nvme: enable PCI P2PDMA support for RDMA transport 2026-04-08 08:25:51 -07:00
sysfs.c nvme: expose TLS mode 2026-04-16 15:05:14 -07:00
tcp.c nvme-tcp: teardown circular locking fixes 2026-04-22 10:07:30 -07:00
trace.c nvme: parse reservation commands's action and rtype to string 2024-11-13 08:51:24 -08:00
trace.h nvme: fix async event trace event 2023-04-13 08:59:04 +02:00
zns.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00