From: Masahiro Yamada Date: Wed, 25 Dec 2024 15:33:35 +0000 (+0900) Subject: modpost: fix the missed iteration for the max bit in do_input() X-Git-Tag: v6.13-rc6~1^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bf36b4bf1b9a7a0015610e2f038ee84ddb085de2;p=thirdparty%2Fkernel%2Flinux.git modpost: fix the missed iteration for the max bit in do_input() 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 Tested-by: John Paul Adrian Glaubitz --- diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 5b5745f00eb30..ff263c2859778 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -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); }