]> err.no Git - linux-2.6/blobdiff - drivers/infiniband/ulp/ipoib/ipoib_multicast.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[linux-2.6] / drivers / infiniband / ulp / ipoib / ipoib_multicast.c
index 8950e9546f4eb64a33fe4dd2b7c7698382b63e37..ac33c8f3ea8580e5120dd98704cfbccb0ccd5c71 100644 (file)
@@ -392,8 +392,16 @@ static int ipoib_mcast_join_complete(int status,
                                           &priv->mcast_task, 0);
                mutex_unlock(&mcast_mutex);
 
-               if (mcast == priv->broadcast)
+               if (mcast == priv->broadcast) {
+                       /*
+                        * Take RTNL lock here to avoid racing with
+                        * ipoib_stop() and turning the carrier back
+                        * on while a device is being removed.
+                        */
+                       rtnl_lock();
                        netif_carrier_on(dev);
+                       rtnl_unlock();
+               }
 
                return 0;
        }