Skip to content

Commit

Permalink
net/mlx4_en: Fix uninitialized use of 'port_up' in mlx4_en_set_channe…
Browse files Browse the repository at this point in the history
…ls()

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: Christian Engelmayer <cengelma@gmx.at>
Acked-By: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Christian Engelmayer authored and David S. Miller committed May 19, 2014
1 parent 614d056 commit da26a62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down

0 comments on commit da26a62

Please sign in to comment.