linux/drivers/nvme/target
Sang-Hoon Choi 4aa9c0f377 nvmet: use the local P2P device on metadata allocation failure
nvmet_req_alloc_p2pmem_sgls() assigns req->p2p_dev only after the data
and metadata SGL allocations succeed. If the data allocation succeeds
but the metadata allocation fails, out_free_sg passes req->p2p_dev to
pci_p2pmem_free_sgl() before that assignment has taken place.

Pass the local p2p_dev argument instead, so cleanup uses the same PCI
device as the successful data allocation.

Fixes: bcd9a0797d ("nvmet: fix freeing unallocated p2pmem")
Reported-by: Changyul Lee <lcy8047@gmail.com>
Reviewed-by: Maurizio Lombardi <mlombard@redhat.com>
Signed-off-by: Sang-Hoon Choi <csh0052@gmail.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
History 2026-10-03 01:57:04 -07:00
..
admin-cmd.c nvmet: fix max_qid race between configfs and controller allocation 2026-08-13 09:26:44 -07:00
auth.c nvmet-auth: Synchronize timeout work during SQ teardown 2026-09-03 14:15:11 -07:00
configfs.c nvmet: preserve device path on allocation failure 2026-09-11 07:48:11 -07:00
core.c nvmet: use the local P2P device on metadata allocation failure 2026-10-03 01:57:04 -07:00
debugfs.c nvmet: expose reservation state through debugfs 2026-07-09 10:08:24 -07:00
debugfs.h nvmet: add namespace-level debugfs directory 2026-07-09 10:08:08 -07:00
discovery.c nvmet: fix pre-auth out-of-bounds heap read in Discovery Get Log Page 2026-06-02 03:43:27 -07:00
fabrics-cmd-auth.c nvmet-auth: fix out-of-bounds write in nvmet_auth_challenge() 2026-09-25 08:06:21 -07:00
fabrics-cmd.c nvmet: fix max_qid race between configfs and controller allocation 2026-08-13 09:26:44 -07:00
fc.c nvmet-fc: fix invalid free in LS IOD error path 2026-08-10 12:00:29 -07:00
fcloop.c block-7.0-20260305 2026-03-06 08:36:18 -08:00
io-cmd-bdev.c nvmet: report NPDGL and NPDAL 2026-03-27 07:35:05 -07:00
io-cmd-file.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Kconfig nvmet-auth: Do not print DH-HMAC-CHAP secrets 2026-05-11 08:07:39 -07:00
loop.c nvme updates for Linux 7.2 2026-06-05 05:18:58 -06:00
Makefile nvmet: New NVMe PCI endpoint function target driver 2025-01-10 19:30:49 -08:00
nvmet.h nvmet: defer setting ns->enabled to false in nvmet_ns_disable() 2026-09-25 08:06:21 -07:00
passthru.c nvmet: passthru: fix OOB reads when parsing ns id descriptor list 2026-08-10 11:51:24 -07:00
pci-epf.c nvmet: pci-epf: reject too-short SGL segments 2026-09-25 08:06:21 -07:00
pr.c nvmet: return Invalid Field for invalid NSIDs feature 82h 2026-10-03 01:52:55 -07:00
rdma.c nvme fixes for Linux 7.3 2026-09-03 19:48:07 -06:00
tcp.c nvmet-tcp: reject unsolicited H2CData PDUs 2026-09-03 14:15:10 -07:00
trace.c nvmet: add tracing of reservation commands 2024-11-13 08:51:24 -08:00
trace.h nvme: trace: avoid memcpy overflow warning 2024-01-05 13:16:18 -08:00
zns.c nvmet: zns: reject full zone report when buffer is too small 2026-08-11 08:53:29 -07:00