Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1797359 authored by Wei Yongjun's avatar Wei Yongjun Committed by Gleb Natapov
Browse files

KVM: x86: fix error return code in kvm_arch_vcpu_init()



Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
parent 8a1b9dd0
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -6752,8 +6752,10 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
	}
	vcpu->arch.mcg_cap = KVM_MAX_MCE_BANKS;

	if (!zalloc_cpumask_var(&vcpu->arch.wbinvd_dirty_mask, GFP_KERNEL))
	if (!zalloc_cpumask_var(&vcpu->arch.wbinvd_dirty_mask, GFP_KERNEL)) {
		r = -ENOMEM;
		goto fail_free_mce_banks;
	}

	r = fx_init(vcpu);
	if (r)