> -----Original Message----- > From: Intel-wired-lan <[email protected]> On Behalf Of Zilin > Guan > Sent: 22 January 2026 08:57 > To: Nguyen, Anthony L <[email protected]> > Cc: Kitszel, Przemyslaw <[email protected]>; > [email protected]; [email protected]; [email protected]; > [email protected]; [email protected]; [email protected]; > [email protected]; [email protected]; [email protected]; > Zilin Guan <[email protected]> > Subject: [Intel-wired-lan] [PATCH net] ice: Fix memory leak in > ice_set_ringparam() > > In ice_set_ringparam, tx_rings and xdp_rings are allocated before rx_rings. > If the allocation of rx_rings fails, the code jumps to the done label leaking > both tx_rings and xdp_rings. Furthermore, if the setup of an individual Rx > ring fails during the loop, the code jumps to the free_tx label which > releases tx_rings but leaks xdp_rings. > > Fix this by introducing a free_xdp label and updating the error paths to > ensure both xdp_rings and tx_rings are properly freed if rx_rings allocation > or setup fails. > > Compile tested only. Issue found using a prototype static analysis tool and > code review. > > Fixes: fcea6f3da546 ("ice: Add stats and ethtool support") > Fixes: efc2214b6047 ("ice: Add support for XDP") > Signed-off-by: Zilin Guan <[email protected]> > --- > drivers/net/ethernet/intel/ice/ice_ethtool.c | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) >
Tested-by: Rinitha S <[email protected]> (A Contingent worker at Intel)
