* [PATCH net] mlxsw: spectrum_router: Fix an IS_ERR() vs NULL check
@ 2023-07-03 15:24 Dan Carpenter
2023-07-03 15:41 ` Alexander Lobakin
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2023-07-03 15:24 UTC (permalink / raw)
To: Petr Machata
Cc: Ido Schimmel, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Danielle Ratson, netdev, kernel-janitors
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(-)
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
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net] mlxsw: spectrum_router: Fix an IS_ERR() vs NULL check
2023-07-03 15:24 [PATCH net] mlxsw: spectrum_router: Fix an IS_ERR() vs NULL check Dan Carpenter
@ 2023-07-03 15:41 ` Alexander Lobakin
2023-07-03 17:06 ` Ido Schimmel
2023-07-04 18:40 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Alexander Lobakin @ 2023-07-03 15:41 UTC (permalink / raw)
To: Dan Carpenter
Cc: Petr Machata, Ido Schimmel, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Danielle Ratson, netdev,
kernel-janitors
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] mlxsw: spectrum_router: Fix an IS_ERR() vs NULL check
2023-07-03 15:24 [PATCH net] mlxsw: spectrum_router: Fix an IS_ERR() vs NULL check Dan Carpenter
2023-07-03 15:41 ` Alexander Lobakin
@ 2023-07-03 17:06 ` Ido Schimmel
2023-07-04 18:40 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Ido Schimmel @ 2023-07-03 17:06 UTC (permalink / raw)
To: Dan Carpenter
Cc: Petr Machata, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Danielle Ratson, netdev, kernel-janitors
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>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] mlxsw: spectrum_router: Fix an IS_ERR() vs NULL check
2023-07-03 15:24 [PATCH net] mlxsw: spectrum_router: Fix an IS_ERR() vs NULL check Dan Carpenter
2023-07-03 15:41 ` Alexander Lobakin
2023-07-03 17:06 ` Ido Schimmel
@ 2023-07-04 18:40 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-07-04 18:40 UTC (permalink / raw)
To: Dan Carpenter
Cc: petrm, idosch, davem, edumazet, kuba, pabeni, danieller, netdev,
kernel-janitors
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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-07-04 18:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-03 15:24 [PATCH net] mlxsw: spectrum_router: Fix an IS_ERR() vs NULL check Dan Carpenter
2023-07-03 15:41 ` Alexander Lobakin
2023-07-03 17:06 ` Ido Schimmel
2023-07-04 18:40 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).