linux-kernelorg-stable/drivers/net/ethernet
Michal Schmidt a30afd6617 i40e: fix IRQ freeing in i40e_vsi_request_irq_msix error path
[ Upstream commit 915470e1b4 ]

If request_irq() in i40e_vsi_request_irq_msix() fails in an iteration
later than the first, the error path wants to free the IRQs requested
so far. However, it uses the wrong dev_id argument for free_irq(), so
it does not free the IRQs correctly and instead triggers the warning:

 Trying to free already-free IRQ 173
 WARNING: CPU: 25 PID: 1091 at kernel/irq/manage.c:1829 __free_irq+0x192/0x2c0
 Modules linked in: i40e(+) [...]
 CPU: 25 UID: 0 PID: 1091 Comm: NetworkManager Not tainted 6.17.0-rc1+ #1 PREEMPT(lazy)
 Hardware name: [...]
 RIP: 0010:__free_irq+0x192/0x2c0
 [...]
 Call Trace:
  <TASK>
  free_irq+0x32/0x70
  i40e_vsi_request_irq_msix.cold+0x63/0x8b [i40e]
  i40e_vsi_request_irq+0x79/0x80 [i40e]
  i40e_vsi_open+0x21f/0x2f0 [i40e]
  i40e_open+0x63/0x130 [i40e]
  __dev_open+0xfc/0x210
  __dev_change_flags+0x1fc/0x240
  netif_change_flags+0x27/0x70
  do_setlink.isra.0+0x341/0xc70
  rtnl_newlink+0x468/0x860
  rtnetlink_rcv_msg+0x375/0x450
  netlink_rcv_skb+0x5c/0x110
  netlink_unicast+0x288/0x3c0
  netlink_sendmsg+0x20d/0x430
  ____sys_sendmsg+0x3a2/0x3d0
  ___sys_sendmsg+0x99/0xe0
  __sys_sendmsg+0x8a/0xf0
  do_syscall_64+0x82/0x2c0
  entry_SYSCALL_64_after_hwframe+0x76/0x7e
  [...]
  </TASK>
 ---[ end trace 0000000000000000 ]---

Use the same dev_id for free_irq() as for request_irq().

I tested this with inserting code to fail intentionally.

Fixes: 493fb30011 ("i40e: Move q_vectors from pointer to array to array of pointers")
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Subbaraya Sundeep <sbhatta@marvell.com>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-09-19 16:35:49 +02:00
..
3com
8390
actions
adaptec
adi
aeroflex
agere
alacritech
allwinner
alteon
altera
amazon
amd
apm
apple
aquantia
arc
asix
atheros
broadcom bnxt_en: fix incorrect page count in RX aggr ring log 2025-09-09 18:58:08 +02:00
brocade
cadence net: macb: Fix tx_ptr_lock locking 2025-09-09 18:58:08 +02:00
calxeda
cavium net: thunder_bgx: decrement cleanup index before use 2025-09-09 18:58:13 +02:00
chelsio
cirrus
cisco
cortina
davicom
dec
dlink
emulex
engleder
ezchip
faraday
freescale net: fec: Fix possible NPD in fec_enet_phy_reset_after_clk_enable() 2025-09-19 16:35:48 +02:00
fujitsu
fungible
google
hisilicon
huawei
i825xx
ibm
intel i40e: fix IRQ freeing in i40e_vsi_request_irq_msix error path 2025-09-19 16:35:49 +02:00
litex
marvell
mediatek net: ethernet: mtk_eth_soc: fix tx vlan tag for llc packets 2025-09-09 18:58:10 +02:00
mellanox net/mlx5: HWS, change error flow on matcher disconnect 2025-09-19 16:35:42 +02:00
meta
micrel
microchip microchip: lan865x: Fix LAN8651 autoloading 2025-09-09 18:58:19 +02:00
microsoft
moxa
mscc
myricom
natsemi
neterion
netronome
ni
nvidia
nxp
oki-semi
packetengines
pasemi
pensando
qlogic
qualcomm
rdc
realtek
renesas
rocker
samsung
seeq
sfc
sgi
silan
sis
smsc
socionext
stmicro
sun
sunplus
synopsys
tehuti
ti
toshiba
tundra
vertexcom
via
wangxun
wiznet
xilinx net: xilinx: axienet: Add error handling for RX metadata pointer retrieval 2025-09-09 18:58:14 +02:00
xircom xirc2ps_cs: fix register access when enabling FullDuplex 2025-09-09 18:58:07 +02:00
xscale
Kconfig
Makefile
dnet.c
dnet.h
ec_bhf.c
ethoc.c
fealnx.c
jme.c
jme.h
korina.c
lantiq_etop.c
lantiq_xrx200.c
oa_tc6.c net: ethernet: oa_tc6: Handle failure of spi_setup 2025-09-09 18:58:17 +02:00