summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWang Hai <wanghai38@huawei.com>2020-11-14 19:52:23 +0800
committerSaeed Mahameed <saeedm@nvidia.com>2020-11-17 11:50:54 -0800
commit68ec32daf7d50a9f7425f8607a7402c13aa0c587 (patch)
treedf19fc020aa20245f169f06b604a410a2c5aa912
parent5b8631c7b21ca8bc039f0bc030048973b039e0d2 (diff)
downloadlinux-68ec32daf7d50a9f7425f8607a7402c13aa0c587.tar.bz2
net/mlx5: fix error return code in mlx5e_tc_nic_init()
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: aedd133d17bc ("net/mlx5e: Support CT offload for tc nic flows") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wang Hai <wanghai38@huawei.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_tc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 2e2fa0440032..ce710f22b1ff 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -5229,8 +5229,10 @@ int mlx5e_tc_nic_init(struct mlx5e_priv *priv)
tc->ct = mlx5_tc_ct_init(priv, tc->chains, &priv->fs.tc.mod_hdr,
MLX5_FLOW_NAMESPACE_KERNEL);
- if (IS_ERR(tc->ct))
+ if (IS_ERR(tc->ct)) {
+ err = PTR_ERR(tc->ct);
goto err_ct;
+ }
tc->netdevice_nb.notifier_call = mlx5e_tc_netdev_event;
err = register_netdevice_notifier_dev_net(priv->netdev,