Commit 0c5c3252 authored by Hannes Frederic Sowa's avatar Hannes Frederic Sowa Committed by David S. Miller

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 <eugenia@mellanox.com>
Cc: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 41419b93
...@@ -1856,6 +1856,7 @@ static void mlx4_en_restart(struct work_struct *work) ...@@ -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); en_dbg(DRV, priv, "Watchdog task called for port %d\n", priv->port);
rtnl_lock();
mutex_lock(&mdev->state_lock); mutex_lock(&mdev->state_lock);
if (priv->port_up) { if (priv->port_up) {
mlx4_en_stop_port(dev, 1); mlx4_en_stop_port(dev, 1);
...@@ -1863,6 +1864,7 @@ static void mlx4_en_restart(struct work_struct *work) ...@@ -1863,6 +1864,7 @@ static void mlx4_en_restart(struct work_struct *work)
en_err(priv, "Failed restarting port %d\n", priv->port); en_err(priv, "Failed restarting port %d\n", priv->port);
} }
mutex_unlock(&mdev->state_lock); mutex_unlock(&mdev->state_lock);
rtnl_unlock();
} }
static void mlx4_en_clear_stats(struct net_device *dev) static void mlx4_en_clear_stats(struct net_device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment