Skip to content

Commit

Permalink
KVM: VMX: Add missing braces to avoid redundant error check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jan Kiszka authored and Gleb Natapov committed Apr 8, 2013
1 parent 458f212 commit a63cb56
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a63cb56

Please sign in to comment.