提交 0c4accc4 编写于 作者: Y YueHaibing 提交者: Saeed Mahameed

net/mlx5: Fix passing zero to 'PTR_ERR'

Fix smatch warnings:

drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_lgcy.c:105 esw_acl_egress_lgcy_setup() warn: passing zero to 'PTR_ERR'
drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_ofld.c:177 esw_acl_egress_ofld_setup() warn: passing zero to 'PTR_ERR'
drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c:184 esw_acl_ingress_lgcy_setup() warn: passing zero to 'PTR_ERR'
drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c:262 esw_acl_ingress_ofld_setup() warn: passing zero to 'PTR_ERR'

esw_acl_table_create() never returns NULL, so
NULL test should be removed.
Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
上级 d894892d
...@@ -101,7 +101,7 @@ int esw_acl_egress_lgcy_setup(struct mlx5_eswitch *esw, ...@@ -101,7 +101,7 @@ int esw_acl_egress_lgcy_setup(struct mlx5_eswitch *esw,
vport->egress.acl = esw_acl_table_create(esw, vport->vport, vport->egress.acl = esw_acl_table_create(esw, vport->vport,
MLX5_FLOW_NAMESPACE_ESW_EGRESS, MLX5_FLOW_NAMESPACE_ESW_EGRESS,
table_size); table_size);
if (IS_ERR_OR_NULL(vport->egress.acl)) { if (IS_ERR(vport->egress.acl)) {
err = PTR_ERR(vport->egress.acl); err = PTR_ERR(vport->egress.acl);
vport->egress.acl = NULL; vport->egress.acl = NULL;
goto out; goto out;
......
...@@ -173,7 +173,7 @@ int esw_acl_egress_ofld_setup(struct mlx5_eswitch *esw, struct mlx5_vport *vport ...@@ -173,7 +173,7 @@ int esw_acl_egress_ofld_setup(struct mlx5_eswitch *esw, struct mlx5_vport *vport
table_size++; table_size++;
vport->egress.acl = esw_acl_table_create(esw, vport->vport, vport->egress.acl = esw_acl_table_create(esw, vport->vport,
MLX5_FLOW_NAMESPACE_ESW_EGRESS, table_size); MLX5_FLOW_NAMESPACE_ESW_EGRESS, table_size);
if (IS_ERR_OR_NULL(vport->egress.acl)) { if (IS_ERR(vport->egress.acl)) {
err = PTR_ERR(vport->egress.acl); err = PTR_ERR(vport->egress.acl);
vport->egress.acl = NULL; vport->egress.acl = NULL;
return err; return err;
......
...@@ -180,7 +180,7 @@ int esw_acl_ingress_lgcy_setup(struct mlx5_eswitch *esw, ...@@ -180,7 +180,7 @@ int esw_acl_ingress_lgcy_setup(struct mlx5_eswitch *esw,
vport->ingress.acl = esw_acl_table_create(esw, vport->vport, vport->ingress.acl = esw_acl_table_create(esw, vport->vport,
MLX5_FLOW_NAMESPACE_ESW_INGRESS, MLX5_FLOW_NAMESPACE_ESW_INGRESS,
table_size); table_size);
if (IS_ERR_OR_NULL(vport->ingress.acl)) { if (IS_ERR(vport->ingress.acl)) {
err = PTR_ERR(vport->ingress.acl); err = PTR_ERR(vport->ingress.acl);
vport->ingress.acl = NULL; vport->ingress.acl = NULL;
return err; return err;
......
...@@ -258,7 +258,7 @@ int esw_acl_ingress_ofld_setup(struct mlx5_eswitch *esw, ...@@ -258,7 +258,7 @@ int esw_acl_ingress_ofld_setup(struct mlx5_eswitch *esw,
vport->ingress.acl = esw_acl_table_create(esw, vport->vport, vport->ingress.acl = esw_acl_table_create(esw, vport->vport,
MLX5_FLOW_NAMESPACE_ESW_INGRESS, MLX5_FLOW_NAMESPACE_ESW_INGRESS,
num_ftes); num_ftes);
if (IS_ERR_OR_NULL(vport->ingress.acl)) { if (IS_ERR(vport->ingress.acl)) {
err = PTR_ERR(vport->ingress.acl); err = PTR_ERR(vport->ingress.acl);
vport->ingress.acl = NULL; vport->ingress.acl = NULL;
return err; return err;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册