Skip to content

Commit

Permalink
[PATCH] IPoIB: fix module removal race
Browse files Browse the repository at this point in the history
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 <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Michael S. Tsirkin authored and Roland Dreier committed Sep 19, 2005
1 parent 6c0741f commit 51574e0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/infiniband/ulp/ipoib/ipoib_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,7 @@ static struct net_device *ipoib_add_port(const char *format,

register_failed:
ib_unregister_event_handler(&priv->event_handler);
flush_scheduled_work();

event_failed:
ipoib_dev_cleanup(priv->dev);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 51574e0

Please sign in to comment.