diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2023-09-13 11:30:03 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2023-09-13 12:16:40 +0200 |
commit | 652a5f22d8312231a50d64ad4c1826947ac5b9a6 (patch) | |
tree | 46ee40a103e0e4fd08fb5bf0783605cfec109279 /target/i386 | |
parent | fb0a8b0e238277296907ffe765bf76874cfc1df6 (diff) |
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: 071ce4b03b ("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>
Diffstat (limited to 'target/i386')
-rw-r--r-- | target/i386/cpu.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 24ee67b42d..bd6a932d08 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -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; } } |