]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
modpost: fix the missed iteration for the max bit in do_input()
authorMasahiro Yamada <masahiroy@kernel.org>
Wed, 25 Dec 2024 15:33:35 +0000 (00:33 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Sat, 28 Dec 2024 14:30:56 +0000 (23:30 +0900)
This loop should iterate over the range from 'min' to 'max' inclusively.
The last interation is missed.

Fixes: 1d8f430c15b3 ("[PATCH] Input: add modalias support")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
scripts/mod/file2alias.c

index 5b5745f00eb306a93247c7bc1e33bf837bc3a152..ff263c285977856dea0d06d7b8148d4bac36b8e6 100644 (file)
@@ -656,7 +656,7 @@ static void do_input(char *alias,
 
        for (i = min / BITS_PER_LONG; i < max / BITS_PER_LONG + 1; i++)
                arr[i] = TO_NATIVE(arr[i]);
-       for (i = min; i < max; i++)
+       for (i = min; i <= max; i++)
                if (arr[i / BITS_PER_LONG] & (1ULL << (i%BITS_PER_LONG)))
                        sprintf(alias + strlen(alias), "%X,*", i);
 }