Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/mlx5: HWS, check the correct variable in hws_send_ring_alloc_sq()

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>
Link: https://patch.msgid.link/da822315-02b7-4f5b-9c86-0d5176c5069d@stanley.mountain
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Dan Carpenter and committed by
Jakub Kicinski
be461814 472d455e

+1 -1
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_send.c
··· 584 584 } 585 585 586 586 sq->wr_priv = kzalloc(sizeof(*sq->wr_priv) * buf_sz, GFP_KERNEL); 587 - if (!sq->dep_wqe) { 587 + if (!sq->wr_priv) { 588 588 err = -ENOMEM; 589 589 goto free_dep_wqe; 590 590 }