From: Ziran Zhang <zhangcoder@yeah.net>
To: Jacob Keller <jacob.e.keller@intel.com>,
Jiri Pirko <jiri@resnulli.us>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Ziran Zhang <zhangcoder@yeah.net>
Subject: Re: [PATCH] rocker: Fix memory leak in ofdpa_port_fdb()
Date: Wed, 17 Jun 2026 09:37:52 +0800 [thread overview]
Message-ID: <20260617013752.5820-1-zhangcoder@yeah.net> (raw)
In-Reply-To: <1446e974-0df0-4956-b2af-7a9403da3c8d@intel.com>
On Tue, 16 Jun 2026 16:29:59 -0700, Jacob Keller wrote:
> I looked at the surrounding code and I can't find any other place that
> would have released the found entry, so this does indeed look like a
> memory leak.
>
> You could potentially verify it using the slab allocator stats and
> setting up a test where you add and remove port fdb in succession and
> see if the allocation of the correct size continue to grow.
>
> This whole flow is somewhat confusing by combining both the add and
> remove into a single functional flow. I guess it is intended to reduce
> code duplication but it sure makes the processes difficult to follow.
>
> I suspect the original code mistook freeing the searched entry as
> freeing the found entry.
>
> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
I don't have Rocker hardware to test the suggestion.
Thanks for the review!
prev parent reply other threads:[~2026-06-17 1:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-16 1:32 [PATCH] rocker: Fix memory leak in ofdpa_port_fdb() Ziran Zhang
2026-06-16 23:29 ` Jacob Keller
2026-06-17 1:37 ` Ziran Zhang [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=20260617013752.5820-1-zhangcoder@yeah.net \
--to=zhangcoder@yeah.net \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jacob.e.keller@intel.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.