From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH] KVM: x86: fix error return code in kvm_arch_vcpu_init() Date: Mon, 22 Apr 2013 10:57:19 +0300 Message-ID: <20130422075719.GI8997@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: mtosatti@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 mx1.redhat.com ([209.132.183.28]:31440 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753380Ab3DVH5h (ORCPT ); Mon, 22 Apr 2013 03:57:37 -0400 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Apr 18, 2013 at 07:41:00AM +0800, Wei Yongjun wrote: > 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 Applied, thanks. > --- > 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) -- Gleb.