Skip to content

Commit b0b2fc8

Browse files
rbrasgakleikamp
authored andcommitted
jfs: UBSAN: shift-out-of-bounds in dbFindBits
Fix issue with UBSAN throwing shift-out-of-bounds warning. Reported-by: [email protected] Signed-off-by: Remington Brasga <[email protected]> Signed-off-by: Dave Kleikamp <[email protected]>
1 parent 3d5f968 commit b0b2fc8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/jfs/jfs_dmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3022,7 +3022,7 @@ static int dbFindBits(u32 word, int l2nb)
30223022

30233023
/* scan the word for nb free bits at nb alignments.
30243024
*/
3025-
for (bitno = 0; mask != 0; bitno += nb, mask >>= nb) {
3025+
for (bitno = 0; mask != 0; bitno += nb, mask = (mask >> nb)) {
30263026
if ((mask & word) == mask)
30273027
break;
30283028
}

0 commit comments

Comments
 (0)