Commit 583f7bc9 authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Wen Zhiwei
Browse files

modpost: fix the missed iteration for the max bit in do_input()

stable inclusion
from stable-v6.6.70
commit bc6962f2dbaf1676c8cbb8b04522f26a186bf416
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IBOHV1

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=bc6962f2dbaf1676c8cbb8b04522f26a186bf416



--------------------------------

[ Upstream commit bf36b4bf1b9a7a0015610e2f038ee84ddb085de2 ]

This loop should iterate over the range from 'min' to 'max' inclusively.
The last interation is missed.

Fixes: 1d8f430c ("[PATCH] Input: add modalias support")
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
Tested-by: default avatarJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarWen Zhiwei <wenzhiwei@kylinos.cn>
parent 56361ef5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -742,7 +742,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);
}