mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: lee@kernel.org, Basavaraj Natikar <Basavaraj.Natikar@amd.com>,
	Vinod Koul <vkoul@kernel.org>, Frank Li <Frank.Li@kernel.org>,
	Sanjay R Mehta <sanju.mehta@amd.com>,
	Gary R Hook <gary.hook@amd.com>,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: [PATCH v2 04/11] dmaengine: ptdma: Unmap descriptor in pt_do_cleanup()
Date: Tue, 17 Nov 2026 16:37:05 +0000	[thread overview]
Message-ID: <20261117163809.622249-5-lee@kernel.org> (raw)
In-Reply-To: <20261117163809.622249-1-lee@kernel.org>

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@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---

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


  parent reply	other threads:[~2026-11-17 16:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 16:37 [PATCH v2 00/11] dmaengine: Fix teardown races, resource leaks, and error handling Lee Jones
2026-11-17 16:37 ` [PATCH v2 01/11] dmaengine: pl08x: Defer OF DMA controller registration until slave setup Lee Jones
2026-11-17 16:37 ` [PATCH v2 02/11] dmaengine: ae4dma: Let the pending work exit before cancelling it Lee Jones
2026-11-17 16:37 ` [PATCH v2 03/11] dmaengine: ae4dma: Unregister DMA engine in ae4_pci_remove() Lee Jones
2026-11-17 16:37 ` Lee Jones [this message]
2026-11-17 16:37 ` [PATCH v2 05/11] dmaengine: ptdma: Remove completed descriptor under vc.lock in pt_cmd_callback_work() Lee Jones
2026-11-17 16:37 ` [PATCH v2 06/11] dmaengine: amlogic: Destroy free_wq after devres DMA device unregistration Lee Jones
2026-11-17 16:37 ` [PATCH v2 07/11] dmaengine: arm-dma350: Query dma_cookie_status() under vc.lock in d350_tx_status() Lee Jones
2026-11-17 16:37 ` [PATCH v2 08/11] dmaengine: bestcomm: Defer publishing bcom_eng until initialisation completes Lee Jones
2026-11-17 16:37 ` [PATCH v2 09/11] dmaengine: bestcomm: Check rh_create() return value in bcom_sram_init() Lee Jones
2026-11-17 16:37 ` [PATCH v2 10/11] dmaengine: jz4780: Fix descriptor cleanup on hwdesc setup failure Lee Jones
2026-11-17 16:37 ` [PATCH v2 11/11] dmaengine: dmatest: Avoid unsigned underflow in min_odd() Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261117163809.622249-5-lee@kernel.org \
    --to=lee@kernel.org \
    --cc=Basavaraj.Natikar@amd.com \
    --cc=Frank.Li@kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=gary.hook@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sanju.mehta@amd.com \
    --cc=stable@vger.kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®