From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] KVM: VMX: Add missing braces to avoid redundant error check Date: Mon, 08 Apr 2013 12:28:28 +0200 Message-ID: <51629BCC.2090803@siemens.com> References: <516288E2.5080501@siemens.com> <20130408094721.GA6159@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , kvm , "Wu, Fengguang" To: Gleb Natapov Return-path: Received: from david.siemens.de ([192.35.17.14]:20113 "EHLO david.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935360Ab3DHK2g (ORCPT ); Mon, 8 Apr 2013 06:28:36 -0400 In-Reply-To: <20130408094721.GA6159@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 2013-04-08 11:47, Gleb Natapov wrote: > 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? # python arch/x86/kvm/vmx.c File "arch/x86/kvm/vmx.c", line 1 /* ^ SyntaxError: invalid syntax Hmm, indeed. That explains our problems... Jan > >> 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. > -- Siemens AG, Corporate Technology, CT RTC ITP SDP-DE Corporate Competence Center Embedded Linux