linux/drivers/net/ethernet
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
..
3com ethernet: 3c509: Improve style of pnp_device_id array terminator 2026-06-13 14:59:06 -07:00
8390 net: Use named initializer for zorro_device_id arrays 2026-05-28 18:07:11 -07:00
actions
adaptec net: Consistently define pci_device_ids using named initializers 2026-05-12 18:16:34 -07:00
adi
aeroflex
agere net: Consistently define pci_device_ids using named initializers 2026-05-12 18:16:34 -07:00
airoha net: airoha: fix max receive size configuration 2026-06-30 11:10:10 +02:00
alacritech
alibaba eea: introduce callback for ndo_get_stats64 and register netdev 2026-05-19 12:07:50 +02:00
allwinner
altera net: altera-tse: fix skb leak on DMA mapping error in tse_start_xmit() 2026-04-02 18:25:23 -07:00
amazon net: ena: clean up XDP TX queues when regular TX setup fails 2026-06-18 18:11:22 -07:00
amd net: au1000: move free_irq out of the close-time spinlocked section 2026-06-23 19:10:29 -07:00
apm net: xgene: fix mdio_np leak in xgene_mdiobus_register() 2026-05-10 10:16:58 -07:00
apple
aquantia net: atlantic: add AQC113 PTP support in aq_ptp and driver core 2026-06-15 15:38:44 -07:00
arc
asix
atheros Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-05-21 15:09:02 -07:00
broadcom bnxt_en: Handle partially initialized auxiliary devices 2026-07-17 12:43:57 +02:00
brocade
cadence net: macb: drop in-flight Tx SKBs on close 2026-07-09 10:48:15 +02:00
calxeda Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
cavium net/liquidio: drop cached VF pci_dev LUT 2026-07-07 11:03:35 +02:00
chelsio cxgb4: Fix decode strings dump for T6 adapters 2026-06-30 17:18:28 -07:00
cirrus Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-05-14 10:08:06 -07:00
cisco enic: detect admin channel resources for SR-IOV 2026-04-02 18:05:06 -07:00
cortina net: ethernet: cortina: Carry over frag counter 2026-05-12 15:20:16 +02:00
davicom
dec net: Consistently define pci_device_ids using named initializers 2026-05-12 18:16:34 -07:00
dlink net: Consistently define pci_device_ids using named initializers 2026-05-12 18:16:34 -07:00
emulex net: eth: benet: Use strscpy() to copy strings into arrays 2026-06-09 18:06:41 -07:00
engleder
ezchip Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
faraday Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
freescale Split <linux/mod_devicetable.h> in per subsystem headers 2026-07-02 20:54:26 -10:00
fungible
google net: ethtool: keep rtnl_lock for ops using ethtool_op_get_link() 2026-06-25 10:18:34 -07:00
hisilicon net: hns3: differentiate autoneg default values between copper and fiber 2026-06-25 09:15:44 -07:00
huawei net: Consistently define pci_device_ids using named initializers 2026-05-12 18:16:34 -07:00
i825xx
ibm Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
intel net: ethtool: keep rtnl_lock for ops using ethtool_op_get_link() 2026-06-25 10:18:34 -07:00
litex
marvell Including fixes from netfilter, Bluetooth and batman-adv. 2026-07-09 08:26:51 -07:00
mediatek net: ethernet: mtk_ppe: Fix rhashtable leak in mtk_ppe_init error paths 2026-06-21 14:33:43 -07:00
mellanox net/mlx5: free mlx5_st_idx_data on final dealloc 2026-07-17 11:50:02 +02:00
meta eth: fbnic: don't cache shinfo across skb realloc 2026-06-29 17:29:15 -07:00
micrel net: Consistently define pci_device_ids using named initializers 2026-05-12 18:16:34 -07:00
microchip net: microchip: vcap: fix races on the shared Super VCAP block 2026-07-05 09:18:47 +02:00
microsoft net: mana: Sync page pool RX frags for CPU 2026-07-09 10:36:14 +02:00
moxa
mscc net: mscc: ocelot: validate netdev belongs to switch in .netdev_to_port() 2026-06-09 17:54:34 -07:00
mucse net: rnpgbe: fix mailbox endianness and remove pointer casts 2026-07-07 10:45:42 +02:00
myricom
natsemi net: Consistently define pci_device_ids using named initializers 2026-05-12 18:16:34 -07:00
netronome bpf-next-7.2 2026-06-17 09:18:14 +01:00
ni
nvidia
nxp
oki-semi net: pch_gbe: handle TX skb allocation failure 2026-06-18 18:00:35 -07:00
pasemi
pensando ionic: Get "link_down_count" ext link stat from firmware 2026-06-15 18:15:08 -07:00
qlogic qede: fix off-by-one in BD ring consumption on build_skb failure 2026-07-06 12:03:10 +02:00
qualcomm net: qualcomm: rmnet: validate MAP frame length before ingress parsing 2026-07-06 12:47:02 +02:00
rdc
realtek Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-06-04 15:29:04 -07:00
renesas net: ethernet: ravb: Do not check URAM suspension when WoL is active 2026-05-12 18:46:19 -07:00
rocker rocker: Fix memory leak in ofdpa_port_fdb() 2026-06-22 16:05:15 -07:00
samsung
seeq
sfc sfc: fix error code in efx_devlink_info_running_versions() 2026-04-30 13:44:30 +02:00
sgi
silan
sis net: ethernet: sis900: correct CONFIG_VLAN_8021Q macro name in comment 2026-06-12 16:13:43 -07:00
smsc net: Consistently define pci_device_ids using named initializers 2026-05-12 18:16:34 -07:00
socionext
spacemit
stmicro Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
sun net: sungem: fix probe error cleanup 2026-06-24 19:26:35 -07:00
sunplus net: ethernet: sunplus: spl2sw: fix phy_node refcount leak in remove 2026-06-24 19:34:56 -07:00
synopsys
tehuti
ti net: ti: icssg: Fix XSK zero copy TX during application wakeup 2026-06-23 14:45:32 -07:00
toshiba
tundra
vertexcom
via
wangxun net: libwx: fix VMDQ mask for 1-queue mode 2026-06-30 11:27:18 +02:00
wiznet w5100: remove unused gpio link detection 2026-05-06 19:18:45 -07:00
xilinx net: axienet: Use dedicated ethtool_ops for the dmaengine path 2026-06-03 19:22:46 -07:00
xircom
xscale Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
ec_bhf.c
ethoc.c
fealnx.c net: Consistently define pci_device_ids using named initializers 2026-05-12 18:16:34 -07:00
jme.c
jme.h
Kconfig eea: introduce PCI framework 2026-05-19 12:07:49 +02:00
korina.c
lantiq_etop.c
lantiq_xrx200.c
Makefile eea: introduce PCI framework 2026-05-19 12:07:49 +02:00
oa_tc6.c net: ethernet: oa_tc6: Remove FCS size in RX frame 2026-06-15 16:32:10 -07:00