From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH] KVM: x86: fix error return code in kvm_arch_vcpu_init() Date: Thu, 18 Apr 2013 10:23:37 +0200 Message-ID: <516FAD89.4060005@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: mtosatti@redhat.com, gleb@redhat.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, yongjun_wei@trendmicro.com.cn, x86@kernel.org, kvm@vger.kernel.org To: Wei Yongjun Return-path: Received: from mail-ea0-f182.google.com ([209.85.215.182]:57329 "EHLO mail-ea0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755831Ab3DRIXs (ORCPT ); Thu, 18 Apr 2013 04:23:48 -0400 Received: by mail-ea0-f182.google.com with SMTP id q15so1143525ead.41 for ; Thu, 18 Apr 2013 01:23:47 -0700 (PDT) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Il 18/04/2013 01:41, Wei Yongjun ha scritto: > From: Wei Yongjun > > Fix to return a negative error code from the error handling > case instead of 0, as returned elsewhere in this function. > > Signed-off-by: Wei Yongjun > --- > arch/x86/kvm/x86.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index e172132..c45d656 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -6706,8 +6706,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) > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Reviewed-by: Paolo Bonzini