net/mlx5e: Fix an IS_ERR() vs NULL check
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 4 Mar 2020 14:22:24 +0000 (17:22 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Mon, 9 Mar 2020 23:58:38 +0000 (16:58 -0700)
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>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c

index bd26a1891b42f799b2d4dea43bdfaba351082923..3bed4f0f2f3d9a3306e2624e35fe7fc1817c4487 100644 (file)
@@ -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;