mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 00:34:20 +08:00
net/mlx5e: mlx5_tc_ct_init does not fail
mlx5_tc_ct_init() either returns a valid pointer or a NULL, either way the caller can continue, remove IS_ERR check from callers as it has no effect. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
This commit is contained in:
parent
fbeab6be05
commit
51ada5a523
@ -4646,10 +4646,6 @@ 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)) {
|
||||
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,
|
||||
@ -4665,7 +4661,6 @@ int mlx5e_tc_nic_init(struct mlx5e_priv *priv)
|
||||
|
||||
err_reg:
|
||||
mlx5_tc_ct_clean(tc->ct);
|
||||
err_ct:
|
||||
mlx5_chains_destroy(tc->chains);
|
||||
err_chains:
|
||||
rhashtable_destroy(&tc->ht);
|
||||
@ -4724,8 +4719,6 @@ int mlx5e_tc_esw_init(struct rhashtable *tc_ht)
|
||||
esw_chains(esw),
|
||||
&esw->offloads.mod_hdr,
|
||||
MLX5_FLOW_NAMESPACE_FDB);
|
||||
if (IS_ERR(uplink_priv->ct_priv))
|
||||
goto err_ct;
|
||||
|
||||
mapping = mapping_create(sizeof(struct tunnel_match_key),
|
||||
TUNNEL_INFO_BITS_MASK, true);
|
||||
@ -4765,7 +4758,6 @@ err_enc_opts_mapping:
|
||||
mapping_destroy(uplink_priv->tunnel_mapping);
|
||||
err_tun_mapping:
|
||||
mlx5_tc_ct_clean(uplink_priv->ct_priv);
|
||||
err_ct:
|
||||
netdev_warn(priv->netdev,
|
||||
"Failed to initialize tc (eswitch), err: %d", err);
|
||||
return err;
|
||||
|
Loading…
Reference in New Issue
Block a user