From f92d4f74de4fd6b233929a47f6bb89536c6274c8 Mon Sep 17 00:00:00 2001 From: Li RongQing Date: Wed, 27 May 2026 23:15:45 -0400 Subject: [PATCH] KVM: x86: Fix wrong return value type in guest_cpuid_has() The function guest_cpuid_has() is declared with a return type of 'bool'. However, when kvm_find_cpuid_entry_index() fails to locate a valid CPUID entry, the code incorrectly returns 'NULL' instead of 'false'. Signed-off-by: Li RongQing Link: https://patch.msgid.link/20260528031545.1879-1-lirongqing@baidu.com Signed-off-by: Sean Christopherson --- arch/x86/kvm/cpuid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h index fc96ba86c644..8d863f45585d 100644 --- a/arch/x86/kvm/cpuid.h +++ b/arch/x86/kvm/cpuid.h @@ -126,7 +126,7 @@ static __always_inline bool guest_cpuid_has(struct kvm_vcpu *vcpu, entry = kvm_find_cpuid_entry_index(vcpu, cpuid.function, cpuid.index); if (!entry) - return NULL; + return false; reg = __cpuid_entry_get_reg(entry, cpuid.reg); if (!reg)