Skip to content

Commit fed488e

Browse files
Dan CarpenterBrian Maly
authored andcommitted
mlxsw: spectrum_router: Fix an IS_ERR() vs NULL check
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]> Orabug: 35622106 (cherry picked from commit 90a8007) cherry-pick-repo=kernel/git/torvalds/linux.git unmodified-from-upstream: 90a8007 Signed-off-by: Mikhael Goikhman <[email protected]> Signed-off-by: Qing Huang <[email protected]> Reviewed-by: Devesh Sharma <[email protected]> Signed-off-by: Brian Maly <[email protected]>
1 parent 39e86af commit fed488e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10794,8 +10794,8 @@ static int mlxsw_sp_lb_rif_init(struct mlxsw_sp *mlxsw_sp,
1079410794
int err;
1079510795

1079610796
router->lb_crif = mlxsw_sp_crif_alloc(NULL);
10797-
if (IS_ERR(router->lb_crif))
10798-
return PTR_ERR(router->lb_crif);
10797+
if (!router->lb_crif)
10798+
return -ENOMEM;
1079910799

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

0 commit comments

Comments
 (0)