net/mlx5e: Fix an IS_ERR() vs NULL check

The esw_vport_tbl_get() function returns error pointers on error.

Fixes: 96e326878f ("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>
This commit is contained in:
Dan Carpenter 2020-03-04 17:22:24 +03:00 committed by Saeed Mahameed
parent 2fbbc30da0
commit d9fb932fde
1 changed files with 1 additions and 1 deletions

View 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;