[PATCH 03/10] dmaengine: ptdma: Unmap descriptor in pt_do_cleanup()
From: Lee Jones
Date: Wed Nov 11 2026 - 16:55:49 EST
When descriptors are freed on abort via vchan_dma_desc_free_list(),
pt_do_cleanup() frees the descriptor without calling
dma_descriptor_unmap(), leaking any attached dmaengine_unmap_data and
DMA mappings.
Call dma_descriptor_unmap(&vd->tx) in pt_do_cleanup() before freeing the
descriptor.
Fixes: b0b4a6b10577 ("dmaengine: ptdma: register PTDMA controller as a DMA resource")
Closes: https://sashiko.dev/#/bug/linux-58b8113b-167a-4398-9be2-c2f3cbf73358
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
---
drivers/dma/amd/ptdma/ptdma-dmaengine.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/dma/amd/ptdma/ptdma-dmaengine.c b/drivers/dma/amd/ptdma/ptdma-dmaengine.c
index 22e7b3ae26a1..405d3d3b7f8a 100644
--- a/drivers/dma/amd/ptdma/ptdma-dmaengine.c
+++ b/drivers/dma/amd/ptdma/ptdma-dmaengine.c
@@ -91,6 +91,7 @@ static void pt_do_cleanup(struct virt_dma_desc *vd)
struct pt_dma_desc *desc = to_pt_desc(vd);
struct pt_device *pt = desc->pt;
+ dma_descriptor_unmap(&vd->tx);
kmem_cache_free(pt->dma_desc_cache, desc);
}
--
2.56.0.567.gdb80ae8cd5-goog