Commit be461814 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jakub Kicinski

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: 2ca62599 ("net/mlx5: HWS, added send engine and context handling")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/da822315-02b7-4f5b-9c86-0d5176c5069d@stanley.mountainSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 472d455e
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment