linux/drivers/net
Zilin Guan fe868b499d 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: fcea6f3da5 ("ice: Add stats and ethtool support")
Fixes: efc2214b60 ("ice: Add support for XDP")
Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2026-03-03 13:06:04 -08:00
..
arcnet Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
bonding bpf/bonding: reject vlan+srcmac xmit_hash_policy change when XDP is loaded 2026-03-03 10:47:37 +01:00
caif treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
can Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
dsa net: dsa: realtek: rtl8365mb: fix rtl8365mb_phy_ocp_write return value 2026-03-02 18:32:40 -08:00
ethernet ice: Fix memory leak in ice_set_ringparam() 2026-03-03 13:06:04 -08:00
fddi
fjes Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hamradio Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hyperv Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
ieee802154 Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
ipa Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
ipvlan Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mctp Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mdio net: mdio: rtl9300: use scoped for loops 2025-12-28 08:55:48 +01:00
netdevsim Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
ovpn Including fixes from IPsec, Bluetooth and netfilter 2026-02-26 08:00:13 -08:00
pcs Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
phy Including fixes from IPsec, Bluetooth and netfilter 2026-02-26 08:00:13 -08:00
plip
ppp Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pse-pd Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
slip Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
team Including fixes from IPsec, Bluetooth and netfilter 2026-02-26 08:00:13 -08:00
thunderbolt net: thunderbolt: Allow reading link settings 2026-01-19 12:09:58 -08:00
usb net: usb: r8152: add TRENDnet TUC-ET2G 2026-02-27 19:27:31 -08:00
vmxnet3 net: vmxnet3: convert to use .get_rx_ring_count 2025-11-19 20:14:21 -08:00
vxlan Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
wan Including fixes from IPsec, Bluetooth and netfilter 2026-02-26 08:00:13 -08:00
wireguard Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
wireless Including fixes from IPsec, Bluetooth and netfilter 2026-02-26 08:00:13 -08:00
wwan Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
xen-netback Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
amt.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
bareudp.c
dummy.c
eql.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
geneve.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
gtp.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
ifb.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Kconfig printk: add CONFIG_PRINTK dependency for netconsole 2026-02-17 13:04:20 +01:00
LICENSE.SRC
loopback.c
macsec.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
macvlan.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
macvtap.c
Makefile net: remove HIPPI support and RoadRunner HIPPI driver 2026-01-20 19:12:06 -08:00
mdio.c
mhi_net.c
mii.c
net_failover.c net: remove unnecessary module_init/exit functions 2026-02-02 17:25:23 -08:00
netconsole.c Including fixes from IPsec, Bluetooth and netfilter 2026-02-26 08:00:13 -08:00
netkit.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
nlmon.c
ntb_netdev.c
pfcp.c
rionet.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Space.c
sungem_phy.c net: sungem_phy: Fix a typo error in sungem_phy 2025-11-04 17:00:55 -08:00
tap.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
tun.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
tun_vnet.h virtio-net: avoid unnecessary checksum calculation on guest RX 2025-11-26 19:45:54 -08:00
veth.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
virtio_net.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
vrf.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
vsockmon.c
xen-netfront.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00