Skip to content

Commit be46181

Browse files
Dan Carpenterkuba-moo
authored andcommitted
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: 2ca6259 ("net/mlx5: HWS, added send engine and context handling") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 472d455 commit be46181

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_send.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ static int hws_send_ring_alloc_sq(struct mlx5_core_dev *mdev,
584584
}
585585

586586
sq->wr_priv = kzalloc(sizeof(*sq->wr_priv) * buf_sz, GFP_KERNEL);
587-
if (!sq->dep_wqe) {
587+
if (!sq->wr_priv) {
588588
err = -ENOMEM;
589589
goto free_dep_wqe;
590590
}

0 commit comments

Comments
 (0)