Skip to content

Commit

Permalink
net/mlx5: DR, Fix potential shift wrapping of 32-bit value in STEv1 g…
Browse files Browse the repository at this point in the history
…etter

Fix 32-bit variable shift wrapping in dr_ste_v1_get_miss_addr.

Fixes: a609812 ("net/mlx5: DR, Add STEv1 setters and getters")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
  • Loading branch information
Yevgeny Kliteynik authored and Saeed Mahameed committed Mar 10, 2021
1 parent dc694f1 commit 84076c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ static void dr_ste_v1_set_miss_addr(u8 *hw_ste_p, u64 miss_addr)
static u64 dr_ste_v1_get_miss_addr(u8 *hw_ste_p)
{
u64 index =
(MLX5_GET(ste_match_bwc_v1, hw_ste_p, miss_address_31_6) |
MLX5_GET(ste_match_bwc_v1, hw_ste_p, miss_address_39_32) << 26);
((u64)MLX5_GET(ste_match_bwc_v1, hw_ste_p, miss_address_31_6) |
((u64)MLX5_GET(ste_match_bwc_v1, hw_ste_p, miss_address_39_32)) << 26);

return index << 6;
}
Expand Down

0 comments on commit 84076c4

Please sign in to comment.