Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
target/i386: Check kvm_hyperv_expand_features() return value
In case more code is added after the kvm_hyperv_expand_features()
call, check its return value (since it can fail).

Fixes: 071ce4b ("i386: expand Hyper-V features during CPU feature expansion time")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230913093009.83520-2-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
philmd authored and bonzini committed Sep 13, 2023
1 parent fb0a8b0 commit 652a5f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions target/i386/cpu.c
Expand Up @@ -7121,8 +7121,8 @@ void x86_cpu_expand_features(X86CPU *cpu, Error **errp)
env->cpuid_xlevel2 = env->cpuid_min_xlevel2;
}

if (kvm_enabled()) {
kvm_hyperv_expand_features(cpu, errp);
if (kvm_enabled() && !kvm_hyperv_expand_features(cpu, errp)) {
return;
}
}

Expand Down

0 comments on commit 652a5f2

Please sign in to comment.