]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ixgbe: fix memory leaks in the ixgbe_recovery_probe() path
authorKohei Enju <enjuk@amazon.com>
Thu, 11 Dec 2025 09:15:31 +0000 (18:15 +0900)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 27 Jan 2026 21:50:09 +0000 (13:50 -0800)
commit638344712aefeba97b6e0d90f560815fd88abd0f
treee31f1108aaaba85262eb884ab573564e390ffd41
parente9acda52fd2ee0cdca332f996da7a95c5fd25294
ixgbe: fix memory leaks in the ixgbe_recovery_probe() path

When ixgbe_recovery_probe() is invoked and this function fails,
allocated resources in advance are not completely freed, because
ixgbe_probe() returns ixgbe_recovery_probe() directly and
ixgbe_recovery_probe() only frees partial resources, resulting in memory
leaks including:
- 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.

Don't return ixgbe_recovery_probe() directly, and instead let
ixgbe_probe() to clean up resources on failures.

Fixes: 29cb3b8d95c7 ("ixgbe: add E610 implementation of FW recovery mode")
Signed-off-by: Kohei Enju <enjuk@amazon.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c