mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Nuno Sá via B4 Relay" <devnull+nuno.sa.analog.com@kernel.org>
To: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Vinod Koul <vkoul@kernel.org>,  Frank Li <Frank.Li@kernel.org>
Subject: [PATCH v3 2/4] dmaengine: dma-axi-dmac: Properly free struct axi_dmac_desc
Date: Wed, 08 Apr 2026 13:42:41 +0100	[thread overview]
Message-ID: <20260408-dma-dmac-handle-vunmap-v3-2-2456ad292154@analog.com> (raw)
In-Reply-To: <20260408-dma-dmac-handle-vunmap-v3-0-2456ad292154@analog.com>

From: Nuno Sá <nuno.sa@analog.com>

In axi_dmac_prep_peripheral_dma_vec() if we fail after calling
axi_dmac_alloc_desc(), we need to use axi_dmac_free_desc() to fully free
the descriptor.

Fixes: 74609e568670 ("dmaengine: dma-axi-dmac: Implement device_prep_peripheral_dma_vec")
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
---
 drivers/dma/dma-axi-dmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c
index 45c2c8e4bc45..127c3cf80a0e 100644
--- a/drivers/dma/dma-axi-dmac.c
+++ b/drivers/dma/dma-axi-dmac.c
@@ -769,7 +769,7 @@ axi_dmac_prep_peripheral_dma_vec(struct dma_chan *c, const struct dma_vec *vecs,
 	for (i = 0; i < nb; i++) {
 		if (!axi_dmac_check_addr(chan, vecs[i].addr) ||
 		    !axi_dmac_check_len(chan, vecs[i].len)) {
-			kfree(desc);
+			axi_dmac_free_desc(desc);
 			return NULL;
 		}
 

-- 
2.53.0



  parent reply	other threads:[~2026-04-08 12:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-08 12:42 [PATCH v3 0/4] dmaengine: dma-axi-dmac: Some memory related fixes Nuno Sá via B4 Relay
2026-04-08 12:42 ` [PATCH v3 1/4] dmaengine: Fix possible use after free Nuno Sá via B4 Relay
2026-04-10  3:00   ` Frank Li
2026-04-08 12:42 ` Nuno Sá via B4 Relay [this message]
2026-04-10  3:02   ` [PATCH v3 2/4] dmaengine: dma-axi-dmac: Properly free struct axi_dmac_desc Frank Li
2026-04-08 12:42 ` [PATCH v3 3/4] dmaengine: dma-axi-dmac: Drop struct clk from main struct Nuno Sá via B4 Relay
2026-04-10  3:03   ` Frank Li
2026-04-08 12:42 ` [PATCH v3 4/4] dmaengine: dma-axi-dmac: Fig BUG() on vunmap() Nuno Sá via B4 Relay
2026-04-10  3:10   ` Frank Li

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=20260408-dma-dmac-handle-vunmap-v3-2-2456ad292154@analog.com \
    --to=devnull+nuno.sa.analog.com@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --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®