Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7bcb974e authored by Michael S. Tsirkin's avatar Michael S. Tsirkin Committed by Roland Dreier
Browse files

IPoIB: Fix another send-only join race



Further, there's an additional issue that I saw in testing:
ipoib_mcast_send may get called when priv->broadcast is NULL (e.g. if
the device was downed and then upped internally because of a port
event).

If this happends and the send-only join request gets completed before
priv->broadcast is set, we get an oops.

Signed-off-by: default avatarMichael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 479a0796
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -701,7 +701,7 @@ void ipoib_mcast_send(struct net_device *dev, union ib_gid *mgid,
	 */
	 */
	spin_lock(&priv->lock);
	spin_lock(&priv->lock);


	if (!test_bit(IPOIB_MCAST_STARTED, &priv->flags)) {
	if (!test_bit(IPOIB_MCAST_STARTED, &priv->flags) || !priv->broadcast) {
		++priv->stats.tx_dropped;
		++priv->stats.tx_dropped;
		dev_kfree_skb_any(skb);
		dev_kfree_skb_any(skb);
		goto unlock;
		goto unlock;