From: Mattijs Korpershoek <mkorpershoek@kernel.org>
To: Gurumoorthy Santhakumar
<gurumoorthy.santhakumar@oss.qualcomm.com>,
marex@denx.de, trini@konsulko.com, mkorpershoek@kernel.org,
macromorgan@hotmail.com, casey.connolly@linaro.org,
quic_varada@quicinc.com, felipe.balbi@linux.intel.com,
gurumoorthy.santhakumar@oss.qualcomm.com, u-boot@lists.denx.de
Subject: Re: [PATCH v2] usb: dwc3: core: fix memory leaks in event buffer cleanup
Date: Fri, 17 Apr 2026 10:14:05 +0200 [thread overview]
Message-ID: <87h5pagg1e.fsf@kernel.org> (raw)
In-Reply-To: <20260416055501.494002-1-gurumoorthy.santhakumar@oss.qualcomm.com>
Hi Gurumoorthy,
Thank you for the patch.
On Thu, Apr 16, 2026 at 11:25, Gurumoorthy Santhakumar <gurumoorthy.santhakumar@oss.qualcomm.com> wrote:
> In dwc3_free_one_event_buffer(), only the DMA buffer (evt->buf) was
> being freed via dma_free_coherent(), but the evt structure itself was
> never explicitly freed, causing a memory leak.
>
> In dwc3_free_event_buffers(), the ev_buffs pointer array allocated
> with memalign() was never freed after iterating and releasing all
> individual event buffers, causing another memory leak.
>
> Fix both leaks by freeing the evt struct in
> dwc3_free_one_event_buffer() and freeing dwc->ev_buffs in
> dwc3_free_event_buffers() after all entries have been released.
>
> Signed-off-by: Gurumoorthy Santhakumar <gurumoorthy.santhakumar@oss.qualcomm.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
prev parent reply other threads:[~2026-04-17 8:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-16 5:55 [PATCH v2] usb: dwc3: core: fix memory leaks in event buffer cleanup Gurumoorthy Santhakumar
2026-04-16 9:06 ` Marek Vasut
2026-04-17 8:14 ` Mattijs Korpershoek [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=87h5pagg1e.fsf@kernel.org \
--to=mkorpershoek@kernel.org \
--cc=casey.connolly@linaro.org \
--cc=felipe.balbi@linux.intel.com \
--cc=gurumoorthy.santhakumar@oss.qualcomm.com \
--cc=macromorgan@hotmail.com \
--cc=marex@denx.de \
--cc=quic_varada@quicinc.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/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