From: Frank Li <Frank.li@oss.nxp.com>
To: Rosen Penev <rosenp@gmail.com>
Cc: dmaengine@vger.kernel.org,
Ludovic Desroches <ludovic.desroches@microchip.com>,
Vinod Koul <vkoul@kernel.org>, Frank Li <Frank.Li@kernel.org>,
Dan Williams <djbw@kernel.org>,
Nicolas Ferre <nicolas.ferre@microchip.com>,
"moderated list:MICROCHIP AT91 DMA DRIVERS"
<linux-arm-kernel@lists.infradead.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] dmaengine: at_hdmac: fix memory leak in atc_prep_slave_sg
Date: Wed, 30 Sep 2026 16:43:30 -0400 [thread overview]
Message-ID: <ar10cvJ5DF4uvtAV@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20260723050402.272606-1-rosenp@gmail.com>
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
>
prev parent reply other threads:[~2026-09-30 20:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-23 5:04 Rosen Penev
2026-09-30 20:43 ` Frank Li [this message]
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=ar10cvJ5DF4uvtAV@lizhi-Precision-Tower-5810 \
--to=frank.li@oss.nxp.com \
--cc=Frank.Li@kernel.org \
--cc=djbw@kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ludovic.desroches@microchip.com \
--cc=nicolas.ferre@microchip.com \
--cc=rosenp@gmail.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®