Commit 78bfe0b5 authored by Michael S. Tsirkin's avatar Michael S. Tsirkin Committed by Roland Dreier

IPoIB: Take dev->xmit_lock around mc_list accesses

dev->mc_list accesses must be protected by dev->xmit_lock.
Found by Eli Cohen <eli@mellanox.co.il>.
Signed-off-by: default avatarMichael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 97460df3
...@@ -827,7 +827,8 @@ void ipoib_mcast_restart_task(void *dev_ptr) ...@@ -827,7 +827,8 @@ void ipoib_mcast_restart_task(void *dev_ptr)
ipoib_mcast_stop_thread(dev, 0); ipoib_mcast_stop_thread(dev, 0);
spin_lock_irqsave(&priv->lock, flags); spin_lock_irqsave(&dev->xmit_lock, flags);
spin_lock(&priv->lock);
/* /*
* Unfortunately, the networking core only gives us a list of all of * Unfortunately, the networking core only gives us a list of all of
...@@ -899,7 +900,9 @@ void ipoib_mcast_restart_task(void *dev_ptr) ...@@ -899,7 +900,9 @@ void ipoib_mcast_restart_task(void *dev_ptr)
list_add_tail(&mcast->list, &remove_list); list_add_tail(&mcast->list, &remove_list);
} }
} }
spin_unlock_irqrestore(&priv->lock, flags);
spin_unlock(&priv->lock);
spin_unlock_irqrestore(&dev->xmit_lock, flags);
/* We have to cancel outside of the spinlock */ /* We have to cancel outside of the spinlock */
list_for_each_entry_safe(mcast, tmcast, &remove_list, list) { list_for_each_entry_safe(mcast, tmcast, &remove_list, list) {
......
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