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 15:38:58 +0000 (16:38 +0100)
commite541982a6e5f5933ec2108f6a41feeb711e8ec82
tree7673b64990ce489a852f42a089fad39091dae42e
parent267eec2d216d5eb646538d51455cfa90fec100d2
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