Message ID | 16334acc-dc95-45be-bc12-53b2a60d9a59@moroto.mountain (mailing list archive) |
---|---|
State | Accepted |
Commit | 90a8007bbeb616e3ea57e2696190e57aa0329531 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net] mlxsw: spectrum_router: Fix an IS_ERR() vs NULL check | expand |
From: Dan Carpenter <dan.carpenter@linaro.org> Date: Mon, 3 Jul 2023 18:24:52 +0300 > The mlxsw_sp_crif_alloc() function returns NULL on error. It doesn't > return error pointers. Fix the check. > > Fixes: 78126cfd5dc9 ("mlxsw: spectrum_router: Maintain CRIF for fallback loopback RIF") > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com> > --- > Applies to net. > > drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) [...] Thanks, Olek
On Mon, Jul 03, 2023 at 06:24:52PM +0300, Dan Carpenter wrote: > The mlxsw_sp_crif_alloc() function returns NULL on error. It doesn't > return error pointers. Fix the check. > > Fixes: 78126cfd5dc9 ("mlxsw: spectrum_router: Maintain CRIF for fallback loopback RIF") > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Hello: This patch was applied to netdev/net.git (main) by David S. Miller <davem@davemloft.net>: On Mon, 3 Jul 2023 18:24:52 +0300 you wrote: > The mlxsw_sp_crif_alloc() function returns NULL on error. It doesn't > return error pointers. Fix the check. > > Fixes: 78126cfd5dc9 ("mlxsw: spectrum_router: Maintain CRIF for fallback loopback RIF") > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> > --- > Applies to net. > > [...] Here is the summary with links: - [net] mlxsw: spectrum_router: Fix an IS_ERR() vs NULL check https://git.kernel.org/netdev/net/c/90a8007bbeb6 You are awesome, thank you!
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c index 445ba7fe3c40..b32adf277a22 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c @@ -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
The mlxsw_sp_crif_alloc() function returns NULL on error. It doesn't return error pointers. Fix the check. Fixes: 78126cfd5dc9 ("mlxsw: spectrum_router: Maintain CRIF for fallback loopback RIF") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> --- Applies to net. drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)