Skip to content

Commit

Permalink
net/mlx5: Fix a NULL vs IS_ERR() check
Browse files Browse the repository at this point in the history
The mlx5_chains_get_table() function doesn't return NULL, it returns
error pointers so we need to fix this condition.

Fixes: 34ca653 ("net/mlx5: E-Switch, Indirect table infrastructure")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Vlad Buslov <vladbu@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
  • Loading branch information
Dan Carpenter authored and Saeed Mahameed committed Feb 11, 2021
1 parent 2dd4571 commit 4782c5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ static int mlx5_esw_indir_table_rule_get(struct mlx5_eswitch *esw,
flow_act.flags = FLOW_ACT_IGNORE_FLOW_LEVEL | FLOW_ACT_NO_APPEND;
dest.type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE;
dest.ft = mlx5_chains_get_table(chains, 0, 1, 0);
if (!dest.ft) {
if (IS_ERR(dest.ft)) {
err = PTR_ERR(dest.ft);
goto err_table;
}
Expand Down

0 comments on commit 4782c5d

Please sign in to comment.