[bug report] net/mlx5: DR, Add STEv1 setters and getters

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

 



Hello Yevgeny Kliteynik,

The patch a6098129c781: "net/mlx5: DR, Add STEv1 setters and getters"
from Sep 22, 2020, leads to the following static checker warning:

	drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c:268 dr_ste_v1_get_miss_addr()
	warn: potential shift truncation.  '0xff (0-255) << 26'

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c
   264  static u64 dr_ste_v1_get_miss_addr(u8 *hw_ste_p)
   265  {
   266          u64 index =
   267                  (MLX5_GET(ste_match_bwc_v1, hw_ste_p, miss_address_31_6) |
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   268                   MLX5_GET(ste_match_bwc_v1, hw_ste_p, miss_address_39_32) << 26);
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

index is a u64 but the right side is a two u32s.  The << 26 can shift
wrap potentially according to Smatch.

   269  
   270          return index << 6;
   271  }

regards,
dan carpenter



[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