]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/Application/Cpuid/Cpuid.c
UefiCpuPkg/Application/Cpuid: Add check for gMaximumBasicFunction
[mirror_edk2.git] / UefiCpuPkg / Application / Cpuid / Cpuid.c
index 371df669941724da9fe42ca87be4407dd11a3e52..f5268cd05ed9d3b29d3b0c2db9c74ecc2daba92d 100644 (file)
@@ -213,6 +213,10 @@ CpuidVersionInfo (
   UINT32                  DisplayFamily;\r
   UINT32                  DisplayModel;\r
 \r
+  if (CPUID_VERSION_INFO > gMaximumBasicFunction) {\r
+    return;\r
+  }\r
+\r
   AsmCpuid (CPUID_VERSION_INFO, &Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx.Uint32);\r
 \r
   Print (L"CPUID_VERSION_INFO (Leaf %08x)\n", CPUID_VERSION_INFO);\r