summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorChen Zhou <chenzhou10@huawei.com>2020-11-17 05:54:26 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2020-11-17 10:40:08 +0300
commit054409ab253d9f31bec5760105144166b4b71e22 (patch)
tree8316c9e642fb1d29eabb14c1d486527ec4a0e40a /arch
parent854c57f02bc718b0653bc467073b4541b8155a36 (diff)
downloadlinux-054409ab253d9f31bec5760105144166b4b71e22.tar.xz
KVM: SVM: fix error return code in svm_create_vcpu()
Fix to return a negative error code from the error handling case instead of 0 in function svm_create_vcpu(), as done elsewhere in this function. Fixes: f4c847a95654 ("KVM: SVM: refactor msr permission bitmap allocation") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Chen Zhou <chenzhou10@huawei.com> Message-Id: <20201117025426.167824-1-chenzhou10@huawei.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/svm/svm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 1e81cfebd491..79b3a564f1c9 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -1309,8 +1309,10 @@ static int svm_create_vcpu(struct kvm_vcpu *vcpu)
svm->avic_is_running = true;
svm->msrpm = svm_vcpu_alloc_msrpm();
- if (!svm->msrpm)
+ if (!svm->msrpm) {
+ err = -ENOMEM;
goto error_free_vmcb_page;
+ }
svm_vcpu_init_msrpm(vcpu, svm->msrpm);