diff options
author | Colin Ian King <colin.king@canonical.com> | 2019-05-04 17:48:29 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-06-19 08:20:57 +0200 |
commit | 4291e45df5cc06ff47a3124cd2857a6513174dd6 (patch) | |
tree | 59fed17a0238dbec1167475ba42e7be7dd1ee1df /drivers/scsi | |
parent | a415e2db35b90200b1990cd2c4024c13859ccd14 (diff) | |
download | linux-stable-4291e45df5cc06ff47a3124cd2857a6513174dd6.tar.gz linux-stable-4291e45df5cc06ff47a3124cd2857a6513174dd6.tar.bz2 linux-stable-4291e45df5cc06ff47a3124cd2857a6513174dd6.zip |
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: 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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc_hwi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi/bnx2fc/bnx2fc_hwi.c index 26de61d65a4d..1bdff75ae903 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_hwi.c +++ b/drivers/scsi/bnx2fc/bnx2fc_hwi.c @@ -830,7 +830,7 @@ ret_err_rqe: ((u64)err_entry->data.err_warn_bitmap_hi << 32) | (u64)err_entry->data.err_warn_bitmap_lo; for (i = 0; i < BNX2FC_NUM_ERR_BITS; i++) { - if (err_warn_bit_map & (u64) (1 << i)) { + if (err_warn_bit_map & ((u64)1 << i)) { err_warn = i; break; } |