linux/drivers/net/ethernet/ibm
Junlin Yang 69cdb7947a ibmvnic: remove excessive irqsave
ibmvnic_remove locks multiple spinlocks while disabling interrupts:
spin_lock_irqsave(&adapter->state_lock, flags);
spin_lock_irqsave(&adapter->rwi_lock, flags);

As reported by coccinelle, the second _irqsave() overwrites the value
saved in 'flags' by the first _irqsave(),   therefore when the second
_irqrestore() comes,the value in 'flags' is not valid,the value saved
by the first _irqsave() has been lost.
This likely leads to IRQs remaining disabled. So remove the second
_irqsave():
spin_lock_irqsave(&adapter->state_lock, flags);
spin_lock(&adapter->rwi_lock);

Generated by: ./scripts/coccinelle/locks/flags.cocci
./drivers/net/ethernet/ibm/ibmvnic.c:5413:1-18:
ERROR: nested lock+irqsave that reuses flags from line 5404.

Fixes: 4a41c421f3 ("ibmvnic: serialize access to work queue on remove")
Signed-off-by: Junlin Yang <yangjunlin@yulong.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-05 13:00:38 -08:00
..
ehea net: ehea: convert tasklets to use new tasklet_setup() API 2020-09-14 13:02:37 -07:00
emac of: Remove of_dev_{get,put}() 2021-02-12 19:23:39 -06:00
ibmveth.c ibmveth: Fix use of ibmveth in a bridge. 2020-10-27 17:52:51 -07:00
ibmveth.h net/ethtool: Introduce link_ksettings API for virtual network devices 2020-02-29 21:48:55 -08:00
ibmvnic.c ibmvnic: remove excessive irqsave 2021-03-05 13:00:38 -08:00
ibmvnic.h net: re-solve some conflicts after net -> net-next merge 2021-02-16 23:12:23 -08:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00