Re: [PATCH] RDMA/mlx5: Prevent UB from shifting negative signed value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 04 Mar 2025 14:02:46 +0000, Qasim Ijaz wrote:
> In function create_ib_ah() the following line attempts
> to left shift the return value of mlx5r_ib_rate() by 4
> and store it in the stat_rate_sl member of av:
> 
> 		ah->av.stat_rate_sl = (mlx5r_ib_rate(dev, rdma_ah_get_static_rate(ah_attr)) << 4);
> 
> However the code overlooks the fact that mlx5r_ib_rate()
> may return -EINVAL if the rate passed to it is less than
> IB_RATE_2_5_GBPS or greater than IB_RATE_800_GBPS.
> 
> [...]

Applied, thanks!

[1/1] RDMA/mlx5: Prevent UB from shifting negative signed value
      https://git.kernel.org/rdma/rdma/c/556f93b90c1872

Best regards,
-- 
Leon Romanovsky <leon@xxxxxxxxxx>





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux