summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
diff options
context:
space:
mode:
authorKamal Heib <kamalh@mellanox.com>2016-09-11 10:56:18 +0300
committerDavid S. Miller <davem@davemloft.net>2016-09-12 05:40:25 +0300
commitc677071741343381f4f555867c04af7ec4a90869 (patch)
treeaf79d64faf4a3930e8140f4c2bcb1b1f19a723c2 /drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
parent74a9e9054456658f047bf71d9108844defde793d (diff)
downloadlinux-c677071741343381f4f555867c04af7ec4a90869.tar.xz
net/mlx4_en: Fix the return value of mlx4_en_dcbnl_set_state()
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: af7d51852631 ("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>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
index 97081e5bafd1..316a70714434 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
@@ -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