IPoIB: Fix another send-only join race
authorMichael S. Tsirkin <mst@mellanox.co.il>
Wed, 8 Feb 2006 00:39:26 +0000 (16:39 -0800)
committerRoland Dreier <rolandd@cisco.com>
Wed, 8 Feb 2006 00:39:26 +0000 (16:39 -0800)
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: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/ulp/ipoib/ipoib_multicast.c

index 1c7148208ce8c67c0cd58dbdb82508302fb3af79..932bf139a65de7ebb90e2fcc9ee15c8cb96d3ce8 100644 (file)
@@ -701,7 +701,7 @@ void ipoib_mcast_send(struct net_device *dev, union ib_gid *mgid,
         */
        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;
                dev_kfree_skb_any(skb);
                goto unlock;