KVM: VMX: Add missing braces to avoid redundant error check
PATCH 1/1 KVM: VMX: Add missing braces to avoid redundant error check
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.
--- arch/x86/kvm/vmx.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
arch/x86/kvm/vmx.c +2 -1
@@ -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)
Signature · 1 line
1.7.3.4
Gleb Natapov
AppliedQuoted 1 line · Jan Kiszka
The code was already properly aligned, now also add the braces to avoid
Are you saying kvm is not written in Python?
Quoted 4 lines
that err is checked even if
alloc_apic_access_pagedidn't run and change it. Found via Coccinelle by Fengguang Wu.Signed-off-by Jan Kiszka <[email protected]>
Applied, thanks.
Quoted 23 lines
--- arch/x86/kvm/vmx.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)arch/x86/kvm/vmx.c +2
-1@@ -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)Signature · 1 line
1.7.3.4
--
Gleb.
Quoted 3 lines · Gleb Natapov
Quoted 1 line · Jan Kiszka
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 syntaxHmm, indeed. That explains our problems...
Jan
Quoted 34 lines
Quoted 5 lines
that err is checked even if
alloc_apic_access_pagedidn't run and change it. Found via Coccinelle by Fengguang Wu.Signed-off-by Jan Kiszka <[email protected]>Applied, thanks.
Quoted 23 lines
--- arch/x86/kvm/vmx.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)arch/x86/kvm/vmx.c +2
-1@@ -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)Signature · 1 line
1.7.3.4--
Gleb.
Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE Corporate Competence Center Embedded Linux