[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b5787c94-2ad0-4519-9cdb-5e82acfebe05@intel.com>
Date: Mon, 8 Dec 2025 17:14:28 -0800
From: Jacob Keller <jacob.e.keller@...el.com>
To: Simon Horman <horms@...nel.org>, Kohei Enju <enjuk@...zon.com>
CC: <intel-wired-lan@...ts.osuosl.org>, <netdev@...r.kernel.org>, Tony Nguyen
<anthony.l.nguyen@...el.com>, Przemek Kitszel <przemyslaw.kitszel@...el.com>,
Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, "Paolo
Abeni" <pabeni@...hat.com>, Jedrzej Jagielski <jedrzej.jagielski@...el.com>,
Mateusz Polchlopek <mateusz.polchlopek@...el.com>, Stefan Wegrzyn
<stefan.wegrzyn@...el.com>, <kohei.enju@...il.com>
Subject: Re: [Intel-wired-lan] [PATCH iwl-net v1] ixgbe: fix memory leaks in
ixgbe_recovery_probe()
On 12/8/2025 9:06 AM, Simon Horman wrote:
> On Sun, Dec 07, 2025 at 12:51:27AM +0900, Kohei Enju wrote:
>> ixgbe_recovery_probe() does not free the following resources in its
>> error path, unlike ixgbe_probe():
>> - adapter->io_addr
>> - adapter->jump_tables[0]
>> - adapter->mac_table
>> - adapter->rss_key
>> - adapter->af_xdp_zc_qps
>>
>> The leaked MMIO region can be observed in /proc/vmallocinfo, and the
>> remaining leaks are reported by kmemleak.
>>
>> Free these allocations and unmap the MMIO region on failure to avoid the
>> leaks.
>>
>> Fixes: 29cb3b8d95c7 ("ixgbe: add E610 implementation of FW recovery mode")
>> Signed-off-by: Kohei Enju <enjuk@...zon.com>
>
> Hi,
>
> It seems that ixgbe_recovery_probe() is only called from ixgbe_probe().
> And that ixgbe_probe() already has an unwind ladder for these resources.
> So I would suggest using that rather than replicating it
> in ixgbe_recovery_probe. That is, have ixgbe_probe() unwind when
> ixgbe_recovery_probe returns an error.
Right. If resources are allocated by ixgbe_probe() they should be freed
in ixgbe_probe() and not in ixgbe_recovery_probe() which is a smaller
function called by ixgbe_probe() to enter recovery mode where only
devlink flash update is enabled.
It looks like most of these resources are allocated by probe and then
ixgbe_recovery_probe() is called, which should instead let regular probe
do cleanup for stuff it didn't setup itself.
>
> Also, maybe I'm wrong, but it seems that hw->aci.lock
> is initialised more than once if ixgbe_recovery_probe() is called.
>
Its initialized in ixgbe_sw_init, which is called before the
ixgbe_recovery_probe, so yes that does look like a double initialization.
> ...
Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (237 bytes)
Powered by blists - more mailing lists