Skip to content

Commit

Permalink
mlxsw: spectrum_router: Fix an IS_ERR() vs NULL check
Browse files Browse the repository at this point in the history
The mlxsw_sp_crif_alloc() function returns NULL on error.  It doesn't
return error pointers.  Fix the check.

Fixes: 78126cf ("mlxsw: spectrum_router: Maintain CRIF for fallback loopback RIF")
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Alexander Lobakin <[email protected]>
Reviewed-by: Ido Schimmel <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Dan Carpenter authored and davem330 committed Jul 4, 2023
1 parent 30c45b5 commit 90a8007
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
Original file line number Diff line number Diff line change
Expand Up @@ -10794,8 +10794,8 @@ static int mlxsw_sp_lb_rif_init(struct mlxsw_sp *mlxsw_sp,
int err;

router->lb_crif = mlxsw_sp_crif_alloc(NULL);
if (IS_ERR(router->lb_crif))
return PTR_ERR(router->lb_crif);
if (!router->lb_crif)
return -ENOMEM;

/* Create a generic loopback RIF associated with the main table
* (default VRF). Any table can be used, but the main table exists
Expand Down

0 comments on commit 90a8007

Please sign in to comment.