From: Michael S. Tsirkin Date: Mon, 12 Sep 2005 16:52:28 +0000 (-0700) Subject: [PATCH] IPoIB: fix module removal race X-Git-Tag: v2.6.14-rc3~150^2~9 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51574e0398a2d93cbf7f26e36b673cd919062268;p=linux-2.6 [PATCH] IPoIB: fix module removal race Since ipoib uses queue_delayed_work to run flush task on port state events, it must flush scheduled work after unregistering the event handler. Signed-off-by: Michael S. Tsirkin Signed-off-by: Roland Dreier --- diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 49d120d2b9..704f48e0b6 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -1005,6 +1005,7 @@ debug_failed: register_failed: ib_unregister_event_handler(&priv->event_handler); + flush_scheduled_work(); event_failed: ipoib_dev_cleanup(priv->dev); @@ -1057,6 +1058,7 @@ static void ipoib_remove_one(struct ib_device *device) list_for_each_entry_safe(priv, tmp, dev_list, list) { ib_unregister_event_handler(&priv->event_handler); + flush_scheduled_work(); unregister_netdev(priv->dev); ipoib_dev_cleanup(priv->dev);