Commit da26a625 authored by Christian Engelmayer's avatar Christian Engelmayer Committed by David S. Miller

net/mlx4_en: Fix uninitialized use of 'port_up' in mlx4_en_set_channels()

Function mlx4_en_set_channels() stops running ports before performing the
requested action. In that case local variable 'port_up' is set so that the
port is restarted at the end of the function, however, in case the port was
not stopped, variable 'port_up' is left uninitialized and the behaviour is
undetermined. Detected by Coverity - CID 751497.
Signed-off-by: default avatarChristian Engelmayer <cengelma@gmx.at>
Acked-By: default avatarAmir Vadai <amirv@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 614d056c
......@@ -1121,7 +1121,7 @@ static int mlx4_en_set_channels(struct net_device *dev,
{
struct mlx4_en_priv *priv = netdev_priv(dev);
struct mlx4_en_dev *mdev = priv->mdev;
int port_up;
int port_up = 0;
int err = 0;
if (channel->other_count || channel->combined_count ||
......
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