From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH] KVM: VMX: Add missing braces to avoid redundant error check Date: Mon, 8 Apr 2013 12:47:21 +0300 Message-ID: <20130408094721.GA6159@redhat.com> References: <516288E2.5080501@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Marcelo Tosatti , kvm , "Wu, Fengguang" To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:43128 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934937Ab3DHJr2 (ORCPT ); Mon, 8 Apr 2013 05:47:28 -0400 Content-Disposition: inline In-Reply-To: <516288E2.5080501@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Apr 08, 2013 at 11:07:46AM +0200, Jan Kiszka wrote: > The code was already properly aligned, now also add the braces to avoid Are you saying kvm is not written in Python? > that err is checked even if alloc_apic_access_page didn't run and change > it. Found via Coccinelle by Fengguang Wu. > > Signed-off-by: Jan Kiszka Applied, thanks. > --- > arch/x86/kvm/vmx.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index cf1aa8f..656b0fa 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -6797,10 +6797,11 @@ static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id) > put_cpu(); > if (err) > goto free_vmcs; > - if (vm_need_virtualize_apic_accesses(kvm)) > + if (vm_need_virtualize_apic_accesses(kvm)) { > err = alloc_apic_access_page(kvm); > if (err) > goto free_vmcs; > + } > > if (enable_ept) { > if (!kvm->arch.ept_identity_map_addr) > -- > 1.7.3.4 -- Gleb.