OrangePi_CM5/drivers/net/ethernet/cavium/liquidio
Colin Ian King 9264bebe9e liquidio: Fix unintentional sign extension issue on left shift of u16
[ Upstream commit e7efc2ce3d0789cd7c21b70ff00cd7838d382639 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-28 14:35:37 +02:00
..
Makefile
…
cn23xx_pf_device.c
…
cn23xx_pf_device.h
…
cn23xx_pf_regs.h
…
cn23xx_vf_device.c
…
cn23xx_vf_device.h
…
cn23xx_vf_regs.h
…
cn66xx_device.c
…
cn66xx_device.h
…
cn66xx_regs.h
…
cn68xx_device.c
…
cn68xx_device.h
…
cn68xx_regs.h
…
lio_core.c
…
lio_ethtool.c
…
lio_main.c
…
lio_vf_main.c
…
lio_vf_rep.c
…
lio_vf_rep.h
…
liquidio_common.h
…
liquidio_image.h
…
octeon_config.h
…
octeon_console.c
…
octeon_device.c
…
octeon_device.h
…
octeon_droq.c
…
octeon_droq.h
…
octeon_iq.h
…
octeon_mailbox.c
…
octeon_mailbox.h
…
octeon_main.h
…
octeon_mem_ops.c
…
octeon_mem_ops.h
…
octeon_network.h
…
octeon_nic.c
…
octeon_nic.h
…
request_manager.c
…
response_manager.c
…
response_manager.h
…