diff options
author | Colin Ian King <colin.king@canonical.com> | 2021-07-14 17:23:43 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-07-15 19:27:33 +0200 |
commit | e7efc2ce3d0789cd7c21b70ff00cd7838d382639 (patch) | |
tree | ab0d1fce592f6779850b47773f3dc98934bb4289 /include | |
parent | net: dsa: mv88e6xxx: NET_DSA_MV88E6XXX_PTP should depend on NET_DSA_MV88E6XXX (diff) | |
download | linux-e7efc2ce3d0789cd7c21b70ff00cd7838d382639.tar.xz linux-e7efc2ce3d0789cd7c21b70ff00cd7838d382639.zip |
liquidio: Fix unintentional sign extension issue on left shift of u16
Shifting the u16 integer oct->pcie_port by CN23XX_PKT_INPUT_CTL_MAC_NUM_POS
(29) bits will be promoted to a 32 bit signed int and then sign-extended
to a u64. In the cases where oct->pcie_port where bit 2 is set (e.g. 3..7)
the shifted value will be sign extended and the top 32 bits of the result
will be set.
Fix this by casting the u16 values to a u64 before the 29 bit left shift.
Addresses-Coverity: ("Unintended sign extension")
Fixes: 3451b97cce2d ("liquidio: CN23XX register setup")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions