cxgb4: Fix race condition in cleanup
authorAnish Bhatt <anish@chelsio.com>
Wed, 20 Aug 2014 20:44:06 +0000 (13:44 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Aug 2014 04:45:36 +0000 (21:45 -0700)
commit29aaee65bc28cc75281dc9fe0998cc5e10ac37f9
tree7cfffd8e08c218490a8ac8ba48ee68a6906e44eb
parent061079ac0b9be7a578dcd09f7865c2c0d6ac894a
cxgb4: Fix race condition in cleanup

There is a possible race condition when we unregister the PCI Driver and then
flush/destroy the global "workq". This could lead to situations where there
are tasks on the Work Queue with references to now deleted adapter data
structures. Instead, have per-adapter Work Queues which were instantiated and
torn down in init_one() and remove_one(), respectively.

v2: Remove unnecessary call to flush_workqueue() before destroy_workqueue()

Signed-off-by: Anish Bhatt <anish@chelsio.com>
Signed-off-by: Casey Leedom <leedom@chelsio.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c