All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net/mlx5: Lag, fix a potential Oops with mlx5_lag_create_definer()
@ 2021-11-10  8:07 Dan Carpenter
  2021-11-10 14:35 ` Leon Romanovsky
  2021-11-10 14:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2021-11-10  8:07 UTC (permalink / raw)
  To: Saeed Mahameed, Maor Gottlieb
  Cc: Leon Romanovsky, David S. Miller, Jakub Kicinski, Mark Bloch,
	netdev, linux-rdma, kernel-janitors

There is a minus character missing from ERR_PTR(ENOMEM) so if this
allocation fails it will lead to an Oops in the caller.

Fixes: dc48516ec7d3 ("net/mlx5: Lag, add support to create definers for LAG")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/lag/port_sel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag/port_sel.c b/drivers/net/ethernet/mellanox/mlx5/core/lag/port_sel.c
index adc836b3d857..ad63dd45c8fb 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lag/port_sel.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lag/port_sel.c
@@ -289,7 +289,7 @@ mlx5_lag_create_definer(struct mlx5_lag *ldev, enum netdev_lag_hash hash,
 
 	lag_definer = kzalloc(sizeof(*lag_definer), GFP_KERNEL);
 	if (!lag_definer)
-		return ERR_PTR(ENOMEM);
+		return ERR_PTR(-ENOMEM);
 
 	match_definer_mask = kvzalloc(MLX5_FLD_SZ_BYTES(match_definer,
 							match_mask),
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net/mlx5: Lag, fix a potential Oops with mlx5_lag_create_definer()
  2021-11-10  8:07 [PATCH net] net/mlx5: Lag, fix a potential Oops with mlx5_lag_create_definer() Dan Carpenter
@ 2021-11-10 14:35 ` Leon Romanovsky
  2021-11-10 14:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2021-11-10 14:35 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Saeed Mahameed, Maor Gottlieb, David S. Miller, Jakub Kicinski,
	Mark Bloch, netdev, linux-rdma, kernel-janitors

On Wed, Nov 10, 2021 at 11:07:06AM +0300, Dan Carpenter wrote:
> There is a minus character missing from ERR_PTR(ENOMEM) so if this
> allocation fails it will lead to an Oops in the caller.
> 
> Fixes: dc48516ec7d3 ("net/mlx5: Lag, add support to create definers for LAG")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/lag/port_sel.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net/mlx5: Lag, fix a potential Oops with mlx5_lag_create_definer()
  2021-11-10  8:07 [PATCH net] net/mlx5: Lag, fix a potential Oops with mlx5_lag_create_definer() Dan Carpenter
  2021-11-10 14:35 ` Leon Romanovsky
@ 2021-11-10 14:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-11-10 14:50 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: saeedm, maorg, leon, davem, kuba, mbloch, netdev, linux-rdma,
	kernel-janitors

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Wed, 10 Nov 2021 11:07:06 +0300 you wrote:
> There is a minus character missing from ERR_PTR(ENOMEM) so if this
> allocation fails it will lead to an Oops in the caller.
> 
> Fixes: dc48516ec7d3 ("net/mlx5: Lag, add support to create definers for LAG")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/lag/port_sel.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [net] net/mlx5: Lag, fix a potential Oops with mlx5_lag_create_definer()
    https://git.kernel.org/netdev/net/c/c7ebe23cee35

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] 3+ messages in thread

end of thread, other threads:[~2021-11-10 14:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-10  8:07 [PATCH net] net/mlx5: Lag, fix a potential Oops with mlx5_lag_create_definer() Dan Carpenter
2021-11-10 14:35 ` Leon Romanovsky
2021-11-10 14:50 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.