Skip to content

Commit

Permalink
net/mlx4_en: Fix the return value of mlx4_en_dcbnl_set_state()
Browse files Browse the repository at this point in the history
mlx4_en_dcbnl_set_state() returns u8, the return value from
mlx4_en_setup_tc() could be negative in case of failure, so fix that.

Fixes: af7d518 ("net/mlx4_en: Add DCB PFC support through CEE netlink commands")
Signed-off-by: Kamal Heib <kamalh@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Kamal Heib authored and David S. Miller committed Sep 12, 2016
1 parent 74a9e90 commit c677071
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,10 @@ static u8 mlx4_en_dcbnl_set_state(struct net_device *dev, u8 state)
priv->flags &= ~MLX4_EN_FLAG_DCB_ENABLED;
}

return mlx4_en_setup_tc(dev, num_tcs);
if (mlx4_en_setup_tc(dev, num_tcs))
return 1;

return 0;
}

/* On success returns a non-zero 802.1p user priority bitmap
Expand Down

0 comments on commit c677071

Please sign in to comment.