[PATCH][7/11] IB/ipoib: use list_for_each_entry_safe when required

From: Roland Dreier
Date: Thu Mar 03 2005 - 01:18:50 EST


From: Shirley Ma <xma@xxxxxxxxxx>

Change uses of list_for_each_entry() where the loop variable is freed
inside the loop to list_for_each_entry_safe().

Signed-off-by: Shirley Ma <xma@xxxxxxxxxx>
Signed-off-by: Roland Dreier <roland@xxxxxxxxxxx>


--- linux-export.orig/drivers/infiniband/ulp/ipoib/ipoib_multicast.c 2005-03-02 20:26:02.832873236 -0800
+++ linux-export/drivers/infiniband/ulp/ipoib/ipoib_multicast.c 2005-03-02 20:26:12.799709771 -0800
@@ -790,7 +790,7 @@

spin_unlock_irqrestore(&priv->lock, flags);

- list_for_each_entry(mcast, &remove_list, list) {
+ list_for_each_entry_safe(mcast, tmcast, &remove_list, list) {
ipoib_mcast_leave(dev, mcast);
ipoib_mcast_free(mcast);
}
@@ -902,7 +902,7 @@
spin_unlock_irqrestore(&priv->lock, flags);

/* We have to cancel outside of the spinlock */
- list_for_each_entry(mcast, &remove_list, list) {
+ list_for_each_entry_safe(mcast, tmcast, &remove_list, list) {
ipoib_mcast_leave(mcast->dev, mcast);
ipoib_mcast_free(mcast);
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/