Re: [PATCH 1/1] OvmfPkg/VmgExitLib: Fix uninitialized variable warning


Yao, Jiewen
 

Hey Brijesh

CI fails - https://github.com/tianocore/edk2/pull/2301
Would you please take a look?

Please remember to submit patch after you run CI next time.

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Yao, Jiewen
Sent: Tuesday, December 14, 2021 10:11 AM
To: Brijesh Singh <brijesh.singh@...>; devel@edk2.groups.io
Cc: James Bottomley <jejb@...>; Xu, Min M <min.m.xu@...>;
Tom Lendacky <thomas.lendacky@...>; Justen, Jordan L
<jordan.l.justen@...>; Ard Biesheuvel <ardb+tianocore@...>;
Aktas, Erdem <erdemaktas@...>; Michael Roth
<Michael.Roth@...>; Gerd Hoffmann <kraxel@...>; Rebecca
Cran <rebecca@...>
Subject: Re: [edk2-devel] [PATCH 1/1] OvmfPkg/VmgExitLib: Fix uninitialized
variable warning

Reviewed-by: Jiewen Yao <Jiewen.yao@...>

-----Original Message-----
From: Brijesh Singh <brijesh.singh@...>
Sent: Tuesday, December 14, 2021 3:39 AM
To: devel@edk2.groups.io
Cc: James Bottomley <jejb@...>; Xu, Min M
<min.m.xu@...>;
Yao, Jiewen <jiewen.yao@...>; Tom Lendacky
<thomas.lendacky@...>; Justen, Jordan L <jordan.l.justen@...>;
Ard Biesheuvel <ardb+tianocore@...>; Aktas, Erdem
<erdemaktas@...>; Michael Roth <Michael.Roth@...>; Gerd
Hoffmann <kraxel@...>; Brijesh Singh <brijesh.singh@...>;
Rebecca Cran <rebecca@...>
Subject: [PATCH 1/1] OvmfPkg/VmgExitLib: Fix uninitialized variable warning

The XCODE5 reported the below warning

OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c:1895:12: note: uninitialized
use occurs here
Compacted
^^^^^^^^^

Initialize the 'Compacted' variable to fix the warning.

Fixes: d2b998fbdca4 (OvmfPkg/VmgExitLib: use SEV-SNP-validated CPUID
values)
Cc: James Bottomley <jejb@...>
Cc: Min Xu <min.m.xu@...>
Cc: Jiewen Yao <jiewen.yao@...>
Cc: Tom Lendacky <thomas.lendacky@...>
Cc: Jordan Justen <jordan.l.justen@...>
Cc: Ard Biesheuvel <ardb+tianocore@...>
Cc: Erdem Aktas <erdemaktas@...>
Cc: Gerd Hoffmann <kraxel@...>
Cc: Rebecca Cran <rebecca@...>
Cc: Michael Roth <Michael.Roth@...>
Signed-off-by: Brijesh Singh <brijesh.singh@...>
---
OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c
b/OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c
index a40a31f7c275..ff367411cc59 100644
--- a/OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c
+++ b/OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c
@@ -1872,6 +1872,7 @@ GetCpuidFw (
UINT32 XSaveSize;

XssMsr.Uint64 = 0;
+ Compacted = FALSE;
if (EcxIn == 1) {
/*
* The PPR and APM aren't clear on what size should be encoded in
--
2.25.1



Join devel@edk2.groups.io to automatically receive all group messages.