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: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>

authored by

Michael S. Tsirkin and committed by
Roland Dreier
78bfe0b5 97460df3

+5 -2
+5 -2
drivers/infiniband/ulp/ipoib/ipoib_multicast.c
··· 827 827 828 828 ipoib_mcast_stop_thread(dev, 0); 829 829 830 - spin_lock_irqsave(&priv->lock, flags); 830 + spin_lock_irqsave(&dev->xmit_lock, flags); 831 + spin_lock(&priv->lock); 831 832 832 833 /* 833 834 * Unfortunately, the networking core only gives us a list of all of ··· 900 899 list_add_tail(&mcast->list, &remove_list); 901 900 } 902 901 } 903 - spin_unlock_irqrestore(&priv->lock, flags); 902 + 903 + spin_unlock(&priv->lock); 904 + spin_unlock_irqrestore(&dev->xmit_lock, flags); 904 905 905 906 /* We have to cancel outside of the spinlock */ 906 907 list_for_each_entry_safe(mcast, tmcast, &remove_list, list) {