From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Selwin Sebastian <selwin.sebastian@amd.com>
Subject: Re: [PATCH 2/4] net/axgbe: fix Rx queue leak on descriptor init failure
Date: Sun, 5 Apr 2026 09:11:31 -0700 [thread overview]
Message-ID: <20260405091131.78575283@phoenix.local> (raw)
In-Reply-To: <20260218164324.915065-3-stephen@networkplumber.org>
On Wed, 18 Feb 2026 08:41:00 -0800
Stephen Hemminger <stephen@networkplumber.org> wrote:
> When wrapper_rx_desc_init() fails to allocate an mbuf for queue i,
> only queue i is released. Queues 0 through i-1 have already been
> fully populated with mbufs assigned to sw_ring entries and
> programmed into hardware descriptors, but are never cleaned up.
> This leaks all mbufs from the previously initialized queues.
>
> Fix by releasing all previously initialized queues when an
> allocation failure occurs.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
AI found off by one in its own patch...
Patch 2 has an off-by-one in the cleanup loop.
The do-while releases queue i first (the failing queue), then loops while i-- > 0.
Since 0 > 0 is false, queue 0 is never released — its mbufs leak.
Should use i-- != 0 or a forward for-loop through 0..i.
next prev parent reply other threads:[~2026-04-05 16:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-18 16:40 [PATCH 0/4] net/axgbe: fix resource leaks and OOB access Stephen Hemminger
2026-02-18 16:40 ` [PATCH 1/4] net/axgbe: fix resource leaks in device init error paths Stephen Hemminger
2026-02-18 16:41 ` [PATCH 2/4] net/axgbe: fix Rx queue leak on descriptor init failure Stephen Hemminger
2026-04-05 16:11 ` Stephen Hemminger [this message]
2026-02-18 16:41 ` [PATCH 3/4] net/axgbe: destroy mutexes on device close Stephen Hemminger
2026-02-18 16:41 ` [PATCH 4/4] net/axgbe: fix descriptor status out-of-bounds access Stephen Hemminger
2026-02-20 17:50 ` [PATCH 0/4] net/axgbe: fix resource leaks and OOB access Stephen Hemminger
2026-02-25 16:52 ` Stephen Hemminger
2026-02-26 12:43 ` Sebastian, Selwin
2026-03-06 18:55 ` Stephen Hemminger
2026-03-08 16:53 ` Ande, Venkat Kumar
2026-03-11 10:53 ` Sebastian, Selwin
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=20260405091131.78575283@phoenix.local \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=selwin.sebastian@amd.com \
/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