KVM: VMX: Add missing braces to avoid redundant error check
authorJan Kiszka <jan.kiszka@siemens.com>
Mon, 8 Apr 2013 09:07:46 +0000 (11:07 +0200)
committerGleb Natapov <gleb@redhat.com>
Mon, 8 Apr 2013 09:46:06 +0000 (12:46 +0300)
The code was already properly aligned, now also add the braces to avoid
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 <jan.kiszka@siemens.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
arch/x86/kvm/vmx.c

index 1cf202cb47d5466e4ab7bcad3c9e2890be3b7dc4..669b80378731f8e0ba3bff957562f46361a69fc5 100644 (file)
@@ -6785,10 +6785,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)