[openib-general] [PATCH] ipoib_flush_paths

Eli Cohen eli at mellanox.co.il
Wed Apr 5 05:59:34 PDT 2006


ib_sa_cancel_query must be called with priv->lock held since
a completion might arrive and set path->query to NULL

Signed-off-by: Eli Cohen <eli at mellanox.co.il>

Index: latest/drivers/infiniband/ulp/ipoib/ipoib_main.c
===================================================================
--- latest.orig/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ latest/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -342,14 +342,16 @@ void ipoib_flush_paths(struct net_device
 	list_for_each_entry(path, &remove_list, list)
 		rb_erase(&path->rb_node, &priv->path_tree);
 
-	spin_unlock_irqrestore(&priv->lock, flags);
 
 	list_for_each_entry_safe(path, tp, &remove_list, list) {
 		if (path->query)
 			ib_sa_cancel_query(path->query_id, path->query);
+		spin_unlock_irqrestore(&priv->lock, flags);
 		wait_for_completion(&path->done);
 		path_free(dev, path);
+		spin_lock_irqsave(&priv->lock, flags);
 	}
+	spin_unlock_irqrestore(&priv->lock, flags);
 }
 
 static void path_rec_completion(int status,



More information about the general mailing list