mlx4: protect mlx4_en_start_port in mlx4_en_restart with rtnl_lock
authorHannes Frederic Sowa <hannes@stressinduktion.org>
Mon, 18 Apr 2016 19:19:44 +0000 (21:19 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Apr 2016 19:35:43 +0000 (15:35 -0400)
mlx4_en_start_port requires rtnl_lock to be held.

Cc: Eugenia Emantayev <eugenia@mellanox.com>
Cc: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_netdev.c

index b4b258c8ca47d47f804fc85adb665e9d08fa48df..8bd143dda95d111f58659ea3342d1a22f1ad8c98 100644 (file)
@@ -1856,6 +1856,7 @@ static void mlx4_en_restart(struct work_struct *work)
 
        en_dbg(DRV, priv, "Watchdog task called for port %d\n", priv->port);
 
+       rtnl_lock();
        mutex_lock(&mdev->state_lock);
        if (priv->port_up) {
                mlx4_en_stop_port(dev, 1);
@@ -1863,6 +1864,7 @@ static void mlx4_en_restart(struct work_struct *work)
                        en_err(priv, "Failed restarting port %d\n", priv->port);
        }
        mutex_unlock(&mdev->state_lock);
+       rtnl_unlock();
 }
 
 static void mlx4_en_clear_stats(struct net_device *dev)