linux/drivers/net
Ruoyu Wang 1cb8553c02 bnxt_en: Handle partially initialized auxiliary devices
bnxt_aux_devices_init() calls auxiliary_device_init() before all fields
used by bnxt_aux_dev_release() are initialized.  After
auxiliary_device_init() succeeds, later errors must unwind with
auxiliary_device_uninit(), which invokes the release callback.

The release callback assumes that aux_priv->id, aux_priv->edev,
edev->net and edev->ulp_tbl are all populated.  If allocation fails
after auxiliary_device_init(), the release path can otherwise dereference
or clear partially initialized state.

Allocate and attach the bnxt_en_dev and ULP table before calling
auxiliary_device_init(), so the release callback only sees a fully
initialized auxiliary private object.  If auxiliary_device_init() itself
fails, free those allocations directly because device_initialize() has not
run and the release callback will not be invoked.

This issue was found by a static analysis checker and confirmed by manual
source review.

Fixes: 194fad5b27 ("bnxt_en: Refactor bnxt_rdma_aux_device_init/uninit functions")
Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Link: https://patch.msgid.link/20260711163716.3996929-1-ruoyuw560@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-17 12:43:57 +02:00
..
arcnet net: arcnet: com20020-pci: avoid -Wformat-truncation warning 2026-05-22 17:20:57 -07:00
bonding bonding: 3ad: fix mux port state on oper down 2026-06-10 07:53:36 -07:00
can can: peak: Modification of references to email accounts being deleted 2026-07-16 09:12:24 +02:00
dsa Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
ethernet bnxt_en: Handle partially initialized auxiliary devices 2026-07-17 12:43:57 +02:00
fddi FDDI: defza: Sanitise the reset safety timer 2026-05-13 17:31:01 -07:00
fjes
hyperv hv_netvsc: use kmap_local_page in netvsc_copy_to_send_buf 2026-06-09 13:16:30 +02:00
ieee802154 Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
ipa net: ipa: fix SMEM state handle leaks in SMP2P init 2026-06-26 18:40:04 -07:00
ipvlan ipvlan: use netif_receive_skb() in ipvlan_process_multicast() 2026-05-13 17:55:14 -07:00
mctp Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-06-11 14:33:35 -07:00
mdio Including fixes from netfilter, Bluetooth and batman-adv. 2026-07-09 08:26:51 -07:00
netdevsim netdevsim: remove ethtool debugfs files before freeing netdev 2026-06-29 18:47:23 -07:00
ovpn Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-05-21 15:09:02 -07:00
pcs Driver core changes for 7.2-rc1 2026-06-15 12:41:17 +05:30
phy Revert "net: phy: sfp: probe for RollBall I2C-to-MDIO bridge in mdio-i2c" 2026-06-29 19:07:42 -07:00
plip
ppp ppp: defer channel free to an RCU grace period to fix pppol2tp RX UAF 2026-07-10 13:31:47 +02:00
pse-pd net: pse-pd: scope pse_control regulator handle to kref lifetime 2026-06-26 18:43:09 -07:00
slip slip: bound decode() reads against the compressed packet length 2026-04-21 10:18:18 +02:00
team net: team: don't recurse on the port's netdev ops lock 2026-06-04 14:04:55 -07:00
thunderbolt Including fixes from netfilter and IPsec. 2026-06-25 12:25:36 -07:00
usb net: usb: lan78xx: disable VLAN filter in promiscuous mode 2026-07-07 13:07:51 +02:00
vmxnet3
vxlan Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-06-04 15:29:04 -07:00
wan Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
wireguard Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-06-01 13:42:12 +02:00
wireless Too many robustness fixes to list. Mostly for 2026-07-10 16:27:45 +02:00
wwan Split <linux/mod_devicetable.h> in per subsystem headers 2026-07-02 20:54:26 -10:00
xen-netback
amt.c amt: fix size calculation in amt_get_size() 2026-07-06 13:01:24 +02:00
bareudp.c bareudp: Use rtnl_dereference() in bareudp_sock_release(). 2026-05-20 19:12:29 -07:00
dummy.c net: change ndo_set_rx_mode_async return type to int 2026-06-09 18:15:29 -07:00
eql.c
geneve.c geneve: validate inner network offset in geneve_gro_complete() 2026-06-24 18:59:29 -07:00
gtp.c udp_tunnel: Pass struct sock to setup_udp_tunnel_sock(). 2026-05-05 17:47:04 -07:00
ifb.c net: ifb: report ethtool stats over num_tx_queues 2026-05-14 18:40:04 -07:00
Kconfig ne2k: fold drivers/net/Space.c into ne.c 2026-05-01 16:46:53 -07:00
LICENSE.SRC
loopback.c
macsec.c macsec: fix promiscuity refcount leak in macsec_dev_open() 2026-07-11 12:52:15 +02:00
macvlan.c macvlan: fix macvlan_get_size() not reserving space for IFLA_MACVLAN_BC_CUTOFF 2026-04-16 12:17:11 +02:00
macvtap.c kernfs: pass struct ns_common instead of const void * for namespace tags 2026-04-09 14:36:52 +02:00
Makefile ne2k: fold drivers/net/Space.c into ne.c 2026-05-01 16:46:53 -07:00
mdio.c
mhi_net.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
mii.c
net_failover.c net: net_failover: Fix the deadlock in slave register 2026-05-13 19:01:03 -07:00
netconsole.c netconsole: don't drop the last byte of a full-sized message 2026-06-18 18:08:41 -07:00
netkit.c net: change ndo_set_rx_mode_async return type to int 2026-06-09 18:15:29 -07:00
nlmon.c
ntb_netdev.c
pfcp.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-06-16 14:59:58 -07:00
rionet.c
sungem_phy.c
tap.c tap: free page on error paths in tap_get_user_xdp() 2026-05-22 10:08:59 -07:00
tun_vnet.h
tun.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-06-11 14:33:35 -07:00
veth.c veth: fix NAPI leak in XDP enable error path 2026-06-23 14:46:32 -07:00
virtio_net.c virtio_net: disable cb when NAPI is busy-polled 2026-06-30 17:03:37 -07:00
vrf.c vrf: Fix a potential NPD when removing a port from a VRF 2026-04-27 17:43:22 -07:00
vsockmon.c
xen-netfront.c