Skip to content

Commit 1f8da43

Browse files
masahir0ygregkh
authored andcommitted
modpost: fix the missed iteration for the max bit in do_input()
[ Upstream commit bf36b4bf1b9a7a0015610e2f038ee84ddb085de2 ] This loop should iterate over the range from 'min' to 'max' inclusively. The last interation is missed. Fixes: 1d8f430 ("[PATCH] Input: add modalias support") Signed-off-by: Masahiro Yamada <[email protected]> Tested-by: John Paul Adrian Glaubitz <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 7635c2d commit 1f8da43

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/mod/file2alias.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ static void do_input(char *alias,
741741

742742
for (i = min / BITS_PER_LONG; i < max / BITS_PER_LONG + 1; i++)
743743
arr[i] = TO_NATIVE(arr[i]);
744-
for (i = min; i < max; i++)
744+
for (i = min; i <= max; i++)
745745
if (arr[i / BITS_PER_LONG] & (1ULL << (i%BITS_PER_LONG)))
746746
sprintf(alias + strlen(alias), "%X,*", i);
747747
}

0 commit comments

Comments
 (0)