scsi: bnx2fc: fix incorrect cast to u64 on shift operation
authorColin Ian King <colin.king@canonical.com>
Sat, 4 May 2019 16:48:29 +0000 (17:48 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 20 May 2019 14:56:43 +0000 (10:56 -0400)
commitd0c0d902339249c75da85fd9257a86cbb98dfaa5
treefc62dedcbe323f281dfb1ba5c0ef27552fa97e53
parent8ef860ae55e96c9e8999a12c800d9fd1a91f66d7
scsi: bnx2fc: fix incorrect cast to u64 on shift operation

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: 7b594769120b ("[SCSI] bnx2fc: Handle REC_TOV error code from firmware")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/bnx2fc/bnx2fc_hwi.c