RE: [PATCH] ice: Fix memleak in ice_set_ringparam
From: Brown, Aaron F
Date: Fri Sep 04 2020 - 22:52:39 EST
> From: Dinghao Liu <dinghao.liu@xxxxxxxxxx>
> Sent: Wednesday, August 26, 2020 7:34 PM
> To: dinghao.liu@xxxxxxxxxx; kjlu@xxxxxxx
> Cc: Kirsher, Jeffrey T <jeffrey.t.kirsher@xxxxxxxxx>; David S. Miller
> <davem@xxxxxxxxxxxxx>; Jakub Kicinski <kuba@xxxxxxxxxx>; Alexei
> Starovoitov <ast@xxxxxxxxxx>; Daniel Borkmann <daniel@xxxxxxxxxxxxx>;
> Jesper Dangaard Brouer <hawk@xxxxxxxxxx>; John Fastabend
> <john.fastabend@xxxxxxxxx>; intel-wired-lan@xxxxxxxxxxxxxxxx;
> netdev@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
> bpf@xxxxxxxxxxxxxxx
> Subject: [PATCH] ice: Fix memleak in ice_set_ringparam
>
> When kcalloc() on rx_rings fails, we should free tx_rings
> and xdp_rings to prevent memleak. Similarly, when
> ice_alloc_rx_bufs() fails, we should free xdp_rings.
>
> Signed-off-by: Dinghao Liu <dinghao.liu@xxxxxxxxxx>
> ---
> drivers/net/ethernet/intel/ice/ice_ethtool.c | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
Tested-by: Aaron Brown <aaron.f.brown@xxxxxxxxx>