Skip to content

Commit

Permalink
net/mlx5e: Initialize link speed to zero
Browse files Browse the repository at this point in the history
mlx5e_port_max_linkspeed does not guarantee value assignment for speed.
Avoid cases where link_speed might be used uninitialized. In case
mlx5e_port_max_linkspeed fails, a default link speed of 50000 will be
used for the calculations.

Fixes: 3f6d08d ("net/mlx5e: Add RSS support for hairpin")
Signed-off-by: Roy Novich <royno@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Aya Levin <ayal@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
  • Loading branch information
Roy Novich authored and Saeed Mahameed committed Mar 21, 2023
1 parent 922f56e commit 6e9d51b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1103,8 +1103,8 @@ static void
mlx5e_hairpin_params_init(struct mlx5e_hairpin_params *hairpin_params,
struct mlx5_core_dev *mdev)
{
u32 link_speed = 0;
u64 link_speed64;
u32 link_speed;

hairpin_params->mdev = mdev;
/* set hairpin pair per each 50Gbs share of the link */
Expand Down

0 comments on commit 6e9d51b

Please sign in to comment.