KVM: apic: avoid calculating pending eoi from an uninitialized val
authorMiaohe Lin <linmiaohe@huawei.com>
Fri, 21 Feb 2020 14:04:46 +0000 (22:04 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Feb 2020 14:42:53 +0000 (15:42 +0100)
commitbd0173761a29eaaaf76469c757040ac1db1c0be8
tree6ed84285552ec831970f6de3010af884501d52cf
parentf3e0dfb310e6a6f0190dbb3d6b337513b548507b
KVM: apic: avoid calculating pending eoi from an uninitialized val

commit 23520b2def95205f132e167cf5b25c609975e959 upstream.

When pv_eoi_get_user() fails, 'val' may remain uninitialized and the return
value of pv_eoi_get_pending() becomes random. Fix the issue by initializing
the variable.

Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/lapic.c