LoongArch: KVM: Avoid overflow with array index
authorBibo Mao <maobibo@loongson.cn>
Thu, 26 Jun 2025 12:07:27 +0000 (20:07 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Thu, 26 Jun 2025 12:07:27 +0000 (20:07 +0800)
commit080e8d2ecdfde588897aa8a87a8884061f4dbbbb
tree7a1db5b941633832b0af93a45e85dcd413d22855
parenta0137c9048252ea965a0436895c77d1c917dfe2a
LoongArch: KVM: Avoid overflow with array index

The variable index is modified and reused as array index when modify
register EIOINTC_ENABLE. There will be array index overflow problem.

Cc: stable@vger.kernel.org
Fixes: 3956a52bc05b ("LoongArch: KVM: Add EIOINTC read and write functions")
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/kvm/intc/eiointc.c