linux/drivers/net
Emil Tantilov 680811c679 idpf: check error for register_netdev() on init
Current init logic ignores the error code from register_netdev(),
which will cause WARN_ON() on attempt to unregister it, if there was one,
and there is no info for the user that the creation of the netdev failed.

WARNING: CPU: 89 PID: 6902 at net/core/dev.c:11512 unregister_netdevice_many_notify+0x211/0x1a10
...
[ 3707.563641]  unregister_netdev+0x1c/0x30
[ 3707.563656]  idpf_vport_dealloc+0x5cf/0xce0 [idpf]
[ 3707.563684]  idpf_deinit_task+0xef/0x160 [idpf]
[ 3707.563712]  idpf_vc_core_deinit+0x84/0x320 [idpf]
[ 3707.563739]  idpf_remove+0xbf/0x780 [idpf]
[ 3707.563769]  pci_device_remove+0xab/0x1e0
[ 3707.563786]  device_release_driver_internal+0x371/0x530
[ 3707.563803]  driver_detach+0xbf/0x180
[ 3707.563816]  bus_remove_driver+0x11b/0x2a0
[ 3707.563829]  pci_unregister_driver+0x2a/0x250

Introduce an error check and log the vport number and error code.
On removal make sure to check VPORT_REG_NETDEV flag prior to calling
unregister and free on the netdev.

Add local variables for idx, vport_config and netdev for readability.

Fixes: 0fe45467a1 ("idpf: add create vport and netdev configuration")
Suggested-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Samuel Salin <Samuel.salin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2025-03-18 09:38:16 -07:00
..
arcnet
bonding bonding: fix incorrect MAC address setting to receive NS messages 2025-03-11 13:19:27 +01:00
caif caif_virtio: fix wrong pointer check in cfv_probe() 2025-02-28 18:04:23 -08:00
can can: flexcan: disable transceiver during system PM 2025-03-14 13:25:43 +01:00
dsa net: dsa: mv88e6xxx: Verify after ATU Load ops 2025-03-07 19:36:33 -08:00
ethernet idpf: check error for register_netdev() on init 2025-03-18 09:38:16 -07:00
fddi
fjes
hamradio
hippi
hyperv hv_netvsc: Replace one-element array with flexible array member 2025-01-17 19:07:48 -08:00
ieee802154 Merge tag 'ieee802154-for-net-2025-01-03' of git://git.kernel.org/pub/scm/linux/kernel/git/wpan/wpan 2025-01-04 17:00:44 -08:00
ipa net: ipa: Enable checksum for IPA_ENDPOINT_AP_MODEM_{RX,TX} for v4.7 2025-03-04 16:19:21 -08:00
ipvlan ipvlan: ensure network headers are in skb linear part 2025-02-21 16:29:50 -08:00
mctp net: mctp i2c: Copy headers if cloned 2025-03-07 19:45:03 -08:00
mdio Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-12-19 11:35:07 -08:00
netdevsim selftests: drv-net: test XDP, HDS auto and the ioctl path 2025-02-24 14:16:37 -08:00
pcs Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-01-16 10:34:59 -08:00
phy net: phy: nxp-c45-tja11xx: add TJA112XB SGMII PCS restart errata 2025-03-07 19:54:25 -08:00
plip
ppp ppp: Fix KMSAN uninit-value warning with bpf 2025-03-04 16:56:41 -08:00
pse-pd net: pse-pd: pd692x0: Fix power limit retrieval 2025-02-18 18:30:27 -08:00
slip
team team: better TEAM_OPTION_TYPE_STRING validation 2025-02-13 08:36:55 -08:00
thunderbolt
usb net: usb: lan78xx: Sanitize return values of register read/write functions 2025-03-10 13:18:44 -07:00
vmxnet3 vmxnet3: Fix tx queue race condition with XDP 2025-02-01 17:17:32 -08:00
vxlan vxlan: check vxlan_vnigroup_init() return value 2025-02-11 15:24:48 -08:00
wan net: wan: framer: Simplify API framer_provider_simple_of_xlate() implementation 2024-12-15 14:13:56 -08:00
wireguard
wireless wifi: iwlwifi: trans: cancel restart work on op mode leave 2025-03-07 09:57:39 +01:00
wwan net: wwan: mhi_wwan_mbim: Silence sequence number glitch errors 2025-02-14 13:39:55 -08:00
xen-netback
amt.c
bareudp.c bareudp: Handle stats using NETDEV_PCPU_STAT_DSTATS. 2024-12-06 17:56:53 -08:00
dummy.c
eql.c
geneve.c geneve: Suppress list corruption splat in geneve_destroy_tunnels(). 2025-02-19 18:49:29 -08:00
gtp.c gtp: Suppress list corruption splat in gtp_net_exit_batch_rtnl(). 2025-02-19 18:49:28 -08:00
ifb.c
Kconfig
LICENSE.SRC
loopback.c net: loopback: Avoid sending IP packets without an Ethernet header 2025-02-21 16:06:46 -08:00
macsec.c
macvlan.c
macvtap.c
Makefile
mdio.c
mhi_net.c
mii.c net: mii: Fix the Speed display when the network cable is not connected 2025-01-20 12:02:38 -08:00
net_failover.c
netconsole.c netconsole: Warn if MAX_USERDATA_ITEMS limit is exceeded 2025-01-09 18:06:36 -08:00
netkit.c netkit: Allow for configuring needed_{head,tail}room 2025-01-06 09:48:49 +01:00
nlmon.c
ntb_netdev.c
pfcp.c pfcp: Destroy device along with udp socket's netns dismantle. 2025-01-14 11:20:04 +01:00
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c ptr_ring: do not block hard interrupts in ptr_ring_resize_multiple() 2024-12-18 17:55:30 -08:00
tun.c tun: revert fix group permission check 2025-02-05 18:22:11 -08:00
veth.c xdp: get rid of xdp_frame::mem.id 2024-12-12 18:22:52 -08:00
virtio_net.c virtio_net: ensure netdev_tx_reset_queue is called on bind xsk for tx 2024-12-10 11:22:21 +01:00
vrf.c vrf: Make pcpu_dstats update functions available to other modules. 2024-12-06 17:56:52 -08:00
vsockmon.c
xen-netfront.c xen/netfront: fix crash when removing device 2024-12-13 09:12:24 +01:00