summaryrefslogtreecommitdiff
path: root/scripts/mod
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2024-12-25 18:33:35 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-01-09 15:30:05 +0300
commit1f8da43e127c7bf1dc459740f26c7da55e32113a (patch)
treeaf70b92ff24504ab29b039d4fb8b8536daba9013 /scripts/mod
parent7635c2d787bb656b6996397b0591091746358198 (diff)
downloadlinux-1f8da43e127c7bf1dc459740f26c7da55e32113a.tar.xz
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: 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'scripts/mod')
-rw-r--r--scripts/mod/file2alias.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index e7d69c9f6341..ba09484ef910 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -741,7 +741,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);
}