From: Hannes Frederic Sowa Date: Mon, 18 Apr 2016 19:19:44 +0000 (+0200) Subject: mlx4: protect mlx4_en_start_port in mlx4_en_restart with rtnl_lock X-Git-Tag: MMI-PSA29.97-13-9~7934^2~224^2~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0c5c3252c43cc935bef05c2211fc7cb32facddf7;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git mlx4: protect mlx4_en_start_port in mlx4_en_restart with rtnl_lock mlx4_en_start_port requires rtnl_lock to be held. Cc: Eugenia Emantayev Cc: Yishai Hadas Signed-off-by: Hannes Frederic Sowa Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index b4b258c8ca47..8bd143dda95d 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c @@ -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)