]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
dmaengine: dma-axi-dmac: Properly free struct axi_dmac_desc
authorNuno Sá <nuno.sa@analog.com>
Fri, 24 Apr 2026 17:40:15 +0000 (18:40 +0100)
committerVinod Koul <vkoul@kernel.org>
Mon, 8 Jun 2026 12:07:06 +0000 (17:37 +0530)
Use axi_dmac_free_desc() to free fully the descriptor at fail path when
call axi_dmac_alloc_desc() in axi_dmac_prep_peripheral_dma_vec().

Fixes: 74609e568670 ("dmaengine: dma-axi-dmac: Implement device_prep_peripheral_dma_vec")
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260424-dma-dmac-handle-vunmap-v4-2-90f43412fdc0@analog.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/dma-axi-dmac.c

index 45c2c8e4bc451dcd8205d05f8347e6d7f5602e19..127c3cf80a0e50a730a06b591aacb48e54cf7a4e 100644 (file)
@@ -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;
                }