[PATCH] IPoIB: Fix device removal race

Currently we may have work scheduled in default kernel workqueue when
the device is going down. The device could get freed before this
workqueue gets serviced. I am actually seeing this causing system
hangs.

The following patch fixes this by using ipoib_workqueue which gets
flushed when the device is going down.

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>

authored by

Michael S. Tsirkin and committed by
Roland Dreier
1ad62a19 fe9e08e1

+1 -1
+1 -1
drivers/infiniband/ulp/ipoib/ipoib_main.c
··· 672 { 673 struct ipoib_dev_priv *priv = netdev_priv(dev); 674 675 - schedule_work(&priv->restart_task); 676 } 677 678 static void ipoib_neigh_destructor(struct neighbour *n)
··· 672 { 673 struct ipoib_dev_priv *priv = netdev_priv(dev); 674 675 + queue_work(ipoib_workqueue, &priv->restart_task); 676 } 677 678 static void ipoib_neigh_destructor(struct neighbour *n)