Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4291e45d authored by Colin Ian King's avatar Colin Ian King Committed by Greg Kroah-Hartman
Browse files

scsi: bnx2fc: fix incorrect cast to u64 on shift operation



[ Upstream commit d0c0d902339249c75da85fd9257a86cbb98dfaa5 ]

Currently an int is being shifted and the result is being cast to a u64
which leads to undefined behaviour if the shift is more than 31 bits. Fix
this by casting the integer value 1 to u64 before the shift operation.

Addresses-Coverity: ("Bad shift operation")
Fixes: 7b594769 ("[SCSI] bnx2fc: Handle REC_TOV error code from firmware")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarSaurav Kashyap <skashyap@marvell.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent a415e2db
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment