mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
LoongArch: KVM: Fix uninitialized stack variable issue with dmsintc
Variable vector[] is declared on stack in function dmsintc_inject_irq()
and sometimes it is used without initialized. Here fix this issue.
Cc: stable@vger.kernel.org
Fixes: 03de5eecb0 ("LoongArch: KVM: Add DMSINTC inject msi to vCPU")
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
This commit is contained in:
parent
5af8b70f56
commit
81aa3a58b5
|
|
@ -19,8 +19,7 @@ void dmsintc_inject_irq(struct kvm_vcpu *vcpu)
|
|||
|
||||
for (i = 0; i < 4; i++) {
|
||||
old = atomic64_read(&(ds->vector_map[i]));
|
||||
if (old)
|
||||
vector[i] = atomic64_xchg(&(ds->vector_map[i]), 0);
|
||||
vector[i] = old ? atomic64_xchg(&(ds->vector_map[i]), 0) : 0;
|
||||
}
|
||||
|
||||
if (vector[0]) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user