* [PATCH] dmaengine: at_hdmac: fix memory leak in atc_prep_slave_sg
@ 2026-07-23 5:04 Rosen Penev
2026-09-30 20:43 ` Frank Li
0 siblings, 1 reply; 2+ messages in thread
From: Rosen Penev @ 2026-07-23 5:04 UTC (permalink / raw)
To: dmaengine
Cc: Ludovic Desroches, Vinod Koul, Frank Li, Dan Williams,
Nicolas Ferre, moderated list:MICROCHIP AT91 DMA DRIVERS,
open list
The default case in the direction switch returns NULL without freeing
the descriptor allocated earlier via kzalloc_flex(). Add the missing
kfree(desc) before returning.
Fixes: 808347f6a317 ("dmaengine: at_hdmac: add DMA slave transfers")
Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/dma/at_hdmac.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index f9c336630fa2..c06f70dbc4c5 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -1381,6 +1381,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
}
break;
default:
+ kfree(desc);
return NULL;
}
--
2.55.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] dmaengine: at_hdmac: fix memory leak in atc_prep_slave_sg
2026-07-23 5:04 [PATCH] dmaengine: at_hdmac: fix memory leak in atc_prep_slave_sg Rosen Penev
@ 2026-09-30 20:43 ` Frank Li
0 siblings, 0 replies; 2+ messages in thread
From: Frank Li @ 2026-09-30 20:43 UTC (permalink / raw)
To: Rosen Penev
Cc: dmaengine, Ludovic Desroches, Vinod Koul, Frank Li, Dan Williams,
Nicolas Ferre, moderated list:MICROCHIP AT91 DMA DRIVERS,
open list
On Wed, Jul 22, 2026 at 10:04:02PM -0700, Rosen Penev wrote:
> The default case in the direction switch returns NULL without freeing
> the descriptor allocated earlier via kzalloc_flex(). Add the missing
> kfree(desc) before returning.
>
> Fixes: 808347f6a317 ("dmaengine: at_hdmac: add DMA slave transfers")
> Assisted-by: opencode:big-pickle
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/dma/at_hdmac.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
> index f9c336630fa2..c06f70dbc4c5 100644
> --- a/drivers/dma/at_hdmac.c
> +++ b/drivers/dma/at_hdmac.c
> @@ -1381,6 +1381,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
> }
> break;
> default:
> + kfree(desc);
> return NULL;
> }
>
> --
> 2.55.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-30 20:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-23 5:04 [PATCH] dmaengine: at_hdmac: fix memory leak in atc_prep_slave_sg Rosen Penev
2026-09-30 20:43 ` Frank Li
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®