mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 02:24:24 +02:00
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: b8b7570a7e ("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>
This commit is contained in:
parent
431e40042d
commit
85686c7296
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user