[PATCH net-next] net/mlx5: Fix a NULL vs IS_ERR() check

Subsystems: mellanox mlx5 core vpi driver, networking drivers, the rest

STALE2003d

3 messages, 3 authors, 2021-02-11 · open the first message on its own page

[PATCH net-next] net/mlx5: Fix a NULL vs IS_ERR() check

From: Dan Carpenter <hidden>
Date: 2021-02-10 11:09:37

The mlx5_chains_get_table() function doesn't return NULL, it returns
error pointers so we need to fix this condition.

Fixes: 34ca65352ddf ("net/mlx5: E-Switch, Indirect table infrastructure")
Signed-off-by: Dan Carpenter <redacted>
---
This applies to net-next but it might actually go through a different
tree before going to net?  I don't know how this works...

 drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c
index b7d00c4c7046..6f6772bf61a2 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c
@@ -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;
 	}
-- 
2.30.0

Re: [PATCH net-next] net/mlx5: Fix a NULL vs IS_ERR() check

From: Vlad Buslov <hidden>
Date: 2021-02-10 11:44:00

On Wed 10 Feb 2021 at 13:06, Dan Carpenter [off-list ref] wrote:
The mlx5_chains_get_table() function doesn't return NULL, it returns
error pointers so we need to fix this condition.

Fixes: 34ca65352ddf ("net/mlx5: E-Switch, Indirect table infrastructure")
Signed-off-by: Dan Carpenter <redacted>
Thanks, Dan!

Reviewed-by: Vlad Buslov <redacted>

Re: [PATCH net-next] net/mlx5: Fix a NULL vs IS_ERR() check

From: Saeed Mahameed <saeed@kernel.org>
Date: 2021-02-11 04:18:48

On Wed, 2021-02-10 at 13:40 +0200, Vlad Buslov wrote:
On Wed 10 Feb 2021 at 13:06, Dan Carpenter [off-list ref]
wrote:
quoted
The mlx5_chains_get_table() function doesn't return NULL, it
returns
error pointers so we need to fix this condition.

Fixes: 34ca65352ddf ("net/mlx5: E-Switch, Indirect table
infrastructure")
Signed-off-by: Dan Carpenter <redacted>
Thanks, Dan!

Reviewed-by: Vlad Buslov <redacted>
Applied to net-next-mlx5

Thanks!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help