Skip to content

Commit 054409a

Browse files
Chen Zhoubonzini
authored andcommitted
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: f4c847a ("KVM: SVM: refactor msr permission bitmap allocation") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Chen Zhou <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 854c57f commit 054409a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arch/x86/kvm/svm/svm.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1309,8 +1309,10 @@ static int svm_create_vcpu(struct kvm_vcpu *vcpu)
13091309
svm->avic_is_running = true;
13101310

13111311
svm->msrpm = svm_vcpu_alloc_msrpm();
1312-
if (!svm->msrpm)
1312+
if (!svm->msrpm) {
1313+
err = -ENOMEM;
13131314
goto error_free_vmcb_page;
1315+
}
13141316

13151317
svm_vcpu_init_msrpm(vcpu, svm->msrpm);
13161318

0 commit comments

Comments
 (0)