]> git.baikalelectronics.ru Git - kernel.git/commit
cxgb4: fix IRQ free race during driver unload
authorShahjada Abul Husain <shahjada@chelsio.com>
Thu, 8 Jul 2021 16:21:56 +0000 (21:51 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Jul 2021 20:34:13 +0000 (13:34 -0700)
commit7acccd20b09f76185d5da76342f244fce37738e8
tree9351dd6b312f32133b19299939d989e15da50585
parentc8d0ee9d0f22bf0af190babb40b679d372789e98
cxgb4: fix IRQ free race during driver unload

IRQs are requested during driver's ndo_open() and then later
freed up in disable_interrupts() during driver unload.
A race exists where driver can set the CXGB4_FULL_INIT_DONE
flag in ndo_open() after the disable_interrupts() in driver
unload path checks it, and hence misses calling free_irq().

Fix by unregistering netdevice first and sync with driver's
ndo_open(). This ensures disable_interrupts() checks the flag
correctly and frees up the IRQs properly.

Fixes: add3b3af20e0 ("cxgb4: Disable interrupts and napi before unregistering netdev")
Signed-off-by: Shahjada Abul Husain <shahjada@chelsio.com>
Signed-off-by: Raju Rangoju <rajur@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c