Commit 90a8007b authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

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: 78126cfd ("mlxsw: spectrum_router: Maintain CRIF for fallback loopback RIF")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarAlexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 30c45b53
...@@ -10794,8 +10794,8 @@ static int mlxsw_sp_lb_rif_init(struct mlxsw_sp *mlxsw_sp, ...@@ -10794,8 +10794,8 @@ static int mlxsw_sp_lb_rif_init(struct mlxsw_sp *mlxsw_sp,
int err; int err;
router->lb_crif = mlxsw_sp_crif_alloc(NULL); router->lb_crif = mlxsw_sp_crif_alloc(NULL);
if (IS_ERR(router->lb_crif)) if (!router->lb_crif)
return PTR_ERR(router->lb_crif); return -ENOMEM;
/* Create a generic loopback RIF associated with the main table /* Create a generic loopback RIF associated with the main table
* (default VRF). Any table can be used, but the main table exists * (default VRF). Any table can be used, but the main table exists
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment