[PATCH v2 04/11] dmaengine: ptdma: Unmap descriptor in pt_do_cleanup()
From: Lee Jones
Date: Tue Nov 17 2026 - 11:38:54 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>
---
v1 => v2: No changes
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 628c49ce5de9..a0a1c7ec2ae5 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.679.gc527c65306-goog