linux-stable/drivers/net/ethernet/cavium
Colin Ian King e7efc2ce3d 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: 3451b97cce ("liquidio: CN23XX register setup")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-07-15 10:27:33 -07:00
..
common net: cavium: Fix a bunch of kerneldoc parameter issues 2020-09-09 14:11:58 -07:00
liquidio liquidio: Fix unintentional sign extension issue on left shift of u16 2021-07-15 10:27:33 -07:00
octeon of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
thunder thunderx: Remove rcu_read_lock() around XDP program invocation 2021-06-24 19:44:02 +02:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00