netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net/mlx5: Fix a NULL vs IS_ERR() check
@ 2021-02-10 11:06 Dan Carpenter
  2021-02-10 11:40 ` Vlad Buslov
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2021-02-10 11:06 UTC (permalink / raw)
  To: Saeed Mahameed, Vlad Buslov
  Cc: Leon Romanovsky, David S. Miller, Jakub Kicinski, Dmytro Linkin,
	Roi Dayan, netdev, linux-rdma, kernel-janitors

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 <dan.carpenter@oracle.com>
---
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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-11  4:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-10 11:06 [PATCH net-next] net/mlx5: Fix a NULL vs IS_ERR() check Dan Carpenter
2021-02-10 11:40 ` Vlad Buslov
2021-02-11  4:17   ` Saeed Mahameed

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).