Skip to content

Commit bc6962f

Browse files
masahir0ygregkh
authored andcommitted
modpost: fix the missed iteration for the max bit in do_input()
[ Upstream commit bf36b4b ] 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 f93e9ae commit bc6962f

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
@@ -742,7 +742,7 @@ static void do_input(char *alias,
742742

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

0 commit comments

Comments
 (0)