kvm: vmx: Fix entry number check for add_atomic_switch_msr()
commit45d51c117ff36cea60b1ab827f77b6af1afe525d
authorXiaoyao Li <xiaoyao.li@linux.intel.com>
Thu, 14 Feb 2019 04:08:58 +0000 (14 12:08 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Feb 2019 09:20:52 +0000 (20 10:20 +0100)
tree768f5c14ab3edd8af217d5c38745dcc63df93c56
parent240f1d1a1c8183c07a12ab322e56f16678efc679
kvm: vmx: Fix entry number check for add_atomic_switch_msr()

commit 98ae70cc476e833332a2c6bb72f941a25f0de226 upstream.

Commit ca83b4a7f2d068da79a0 ("x86/KVM/VMX: Add find_msr() helper function")
introduces the helper function find_msr(), which returns -ENOENT when
not find the msr in vmx->msr_autoload.guest/host. Correct checking contion
of no more available entry in vmx->msr_autoload.

Fixes: ca83b4a7f2d0 ("x86/KVM/VMX: Add find_msr() helper function")
Cc: stable@vger.kernel.org
Signed-off-by: Xiaoyao Li <xiaoyao.li@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/vmx.c