diff options
author | Shahjada Abul Husain <shahjada@chelsio.com> | 2021-07-08 21:51:56 +0530 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-07-08 13:34:13 -0700 |
commit | 015fe6fd29c4b9ac0f61b8c4455ef88e6018b9cc (patch) | |
tree | 9351dd6b312f32133b19299939d989e15da50585 /drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c | |
parent | mt76: mt7921: continue to probe driver when fw already downloaded (diff) | |
download | linux-dev-015fe6fd29c4b9ac0f61b8c4455ef88e6018b9cc.tar.xz linux-dev-015fe6fd29c4b9ac0f61b8c4455ef88e6018b9cc.zip |
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: b37987e8db5f ("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>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c index 743af9e654aa..17faac715882 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c @@ -581,6 +581,9 @@ void t4_uld_clean_up(struct adapter *adap) { unsigned int i; + if (!is_uld(adap)) + return; + mutex_lock(&uld_mutex); for (i = 0; i < CXGB4_ULD_MAX; i++) { if (!adap->uld[i].handle) |