netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net/mlx5: HWS, check the correct variable in hws_send_ring_alloc_sq()
@ 2024-09-14  9:58 Dan Carpenter
  2024-09-14 15:39 ` Simon Horman
  2024-09-15 16:01 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2024-09-14  9:58 UTC (permalink / raw)
  To: Yevgeny Kliteynik
  Cc: Saeed Mahameed, Leon Romanovsky, Tariq Toukan, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Itamar Gozlan, netdev,
	linux-rdma, linux-kernel, kernel-janitors

There is a copy and paste bug so this code checks "sq->dep_wqe" where
"sq->wr_priv" was intended.  It could result in a NULL pointer
dereference.

Fixes: 2ca62599aa0b ("net/mlx5: HWS, added send engine and context handling")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 .../net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_send.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_send.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_send.c
index fb97a15c041a..a1adbb48735c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_send.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_send.c
@@ -584,7 +584,7 @@ static int hws_send_ring_alloc_sq(struct mlx5_core_dev *mdev,
 	}
 
 	sq->wr_priv = kzalloc(sizeof(*sq->wr_priv) * buf_sz, GFP_KERNEL);
-	if (!sq->dep_wqe) {
+	if (!sq->wr_priv) {
 		err = -ENOMEM;
 		goto free_dep_wqe;
 	}
-- 
2.45.2


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

* Re: [PATCH net-next] net/mlx5: HWS, check the correct variable in hws_send_ring_alloc_sq()
  2024-09-14  9:58 [PATCH net-next] net/mlx5: HWS, check the correct variable in hws_send_ring_alloc_sq() Dan Carpenter
@ 2024-09-14 15:39 ` Simon Horman
  2024-09-15 16:01 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2024-09-14 15:39 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Yevgeny Kliteynik, Saeed Mahameed, Leon Romanovsky, Tariq Toukan,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Itamar Gozlan, netdev, linux-rdma, linux-kernel, kernel-janitors

On Sat, Sep 14, 2024 at 12:58:26PM +0300, Dan Carpenter wrote:
> There is a copy and paste bug so this code checks "sq->dep_wqe" where
> "sq->wr_priv" was intended.  It could result in a NULL pointer
> dereference.
> 
> Fixes: 2ca62599aa0b ("net/mlx5: HWS, added send engine and context handling")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Reviewed-by: Simon Horman <horms@kernel.org>


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

* Re: [PATCH net-next] net/mlx5: HWS, check the correct variable in hws_send_ring_alloc_sq()
  2024-09-14  9:58 [PATCH net-next] net/mlx5: HWS, check the correct variable in hws_send_ring_alloc_sq() Dan Carpenter
  2024-09-14 15:39 ` Simon Horman
@ 2024-09-15 16:01 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-09-15 16:01 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: kliteyn, saeedm, leon, tariqt, davem, edumazet, kuba, pabeni,
	igozlan, netdev, linux-rdma, linux-kernel, kernel-janitors

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sat, 14 Sep 2024 12:58:26 +0300 you wrote:
> There is a copy and paste bug so this code checks "sq->dep_wqe" where
> "sq->wr_priv" was intended.  It could result in a NULL pointer
> dereference.
> 
> Fixes: 2ca62599aa0b ("net/mlx5: HWS, added send engine and context handling")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> 
> [...]

Here is the summary with links:
  - [net-next] net/mlx5: HWS, check the correct variable in hws_send_ring_alloc_sq()
    https://git.kernel.org/netdev/net-next/c/be461814aa4c

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:[~2024-09-15 16:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-14  9:58 [PATCH net-next] net/mlx5: HWS, check the correct variable in hws_send_ring_alloc_sq() Dan Carpenter
2024-09-14 15:39 ` Simon Horman
2024-09-15 16:01 ` 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).