Commit c33bb844 authored by Shirley Ma's avatar Shirley Ma Committed by Linus Torvalds

[PATCH] IB/ipoib: use list_for_each_entry_safe when required

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: default avatarShirley Ma <xma@us.ibm.com>
Signed-off-by: default avatarRoland Dreier <roland@topspin.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 5273d629
......@@ -790,7 +790,7 @@ void ipoib_mcast_dev_flush(struct net_device *dev)
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 @@ void ipoib_mcast_restart_task(void *dev_ptr)
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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment