mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 08:46:46 +00:00
scsi: bnx2fc: fix incorrect cast to u64 on shift operation
[ Upstream commitd0c0d90233
] 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:7b59476912
("[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>
This commit is contained in:
parent
a415e2db35
commit
4291e45df5
1 changed files with 1 additions and 1 deletions
|
@ -830,7 +830,7 @@ static void bnx2fc_process_unsol_compl(struct bnx2fc_rport *tgt, u16 wqe)
|
||||||
((u64)err_entry->data.err_warn_bitmap_hi << 32) |
|
((u64)err_entry->data.err_warn_bitmap_hi << 32) |
|
||||||
(u64)err_entry->data.err_warn_bitmap_lo;
|
(u64)err_entry->data.err_warn_bitmap_lo;
|
||||||
for (i = 0; i < BNX2FC_NUM_ERR_BITS; i++) {
|
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;
|
err_warn = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue