Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PATCH] net/mlx5e: Fix an IS_ERR() vs NULL check
@ 2020-03-04 14:22 Dan Carpenter
  2020-03-04 20:31 ` Saeed Mahameed
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2020-03-04 14:22 UTC (permalink / raw)
  To: Saeed Mahameed, Eli Cohen
  Cc: Leon Romanovsky, Mark Bloch, Paul Blakey, linux-rdma,
	kernel-janitors

The esw_vport_tbl_get() function returns error pointers on error.

Fixes: 96e326878fa5 ("net/mlx5e: Eswitch, Use per vport tables for mirroring")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 4b5b6618dff4..692fe9e6a08f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -198,7 +198,7 @@ int mlx5_esw_vport_tbl_get(struct mlx5_eswitch *esw)
 	mlx5_esw_for_all_vports(esw, i, vport) {
 		attr.in_rep->vport = vport->vport;
 		fdb = esw_vport_tbl_get(esw, &attr);
-		if (!fdb)
+		if (IS_ERR(fdb))
 			goto out;
 	}
 	return 0;
-- 
2.11.0


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

end of thread, other threads:[~2020-03-05 23:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-04 14:22 [PATCH] net/mlx5e: Fix an IS_ERR() vs NULL check Dan Carpenter
2020-03-04 20:31 ` Saeed Mahameed
2020-03-05  8:00   ` Dan Carpenter
2020-03-05 23:11     ` Saeed Mahameed

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox