Skip to content

Commit e64285f

Browse files
dmantipovkuba-moo
authored andcommitted
rocker: fix link status detection in rocker_carrier_init()
Since '1 << rocker_port->pport' may be undefined for port >= 32, cast the left operand to 'unsigned long long' like it's done in 'rocker_port_set_enable()' above. Compile tested only. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Link: https://patch.msgid.link/20241114151946.519047-1-dmantipov@yandex.ru Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent a0c80d5 commit e64285f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/net/ethernet/rocker/rocker_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2502,7 +2502,7 @@ static void rocker_carrier_init(const struct rocker_port *rocker_port)
25022502
u64 link_status = rocker_read64(rocker, PORT_PHYS_LINK_STATUS);
25032503
bool link_up;
25042504

2505-
link_up = link_status & (1 << rocker_port->pport);
2505+
link_up = link_status & (1ULL << rocker_port->pport);
25062506
if (link_up)
25072507
netif_carrier_on(rocker_port->dev);
25082508
else

0 commit comments

Comments
 (0)