[edk2-devel] [PATCH 1/1] OvmfPkg/VmgExitLib: Fix uninitialized variable warning

Yao, Jiewen jiewen.yao at intel.com
Tue Dec 14 02:10:50 UTC 2021


Reviewed-by: Jiewen Yao <Jiewen.yao at intel.com>

> -----Original Message-----
> From: Brijesh Singh <brijesh.singh at amd.com>
> Sent: Tuesday, December 14, 2021 3:39 AM
> To: devel at edk2.groups.io
> Cc: James Bottomley <jejb at linux.ibm.com>; Xu, Min M <min.m.xu at intel.com>;
> Yao, Jiewen <jiewen.yao at intel.com>; Tom Lendacky
> <thomas.lendacky at amd.com>; Justen, Jordan L <jordan.l.justen at intel.com>;
> Ard Biesheuvel <ardb+tianocore at kernel.org>; Aktas, Erdem
> <erdemaktas at google.com>; Michael Roth <Michael.Roth at amd.com>; Gerd
> Hoffmann <kraxel at redhat.com>; Brijesh Singh <brijesh.singh at amd.com>;
> Rebecca Cran <rebecca at bsdio.com>
> 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 at linux.ibm.com>
> Cc: Min Xu <min.m.xu at intel.com>
> Cc: Jiewen Yao <jiewen.yao at intel.com>
> Cc: Tom Lendacky <thomas.lendacky at amd.com>
> Cc: Jordan Justen <jordan.l.justen at intel.com>
> Cc: Ard Biesheuvel <ardb+tianocore at kernel.org>
> Cc: Erdem Aktas <erdemaktas at google.com>
> Cc: Gerd Hoffmann <kraxel at redhat.com>
> Cc: Rebecca Cran <rebecca at bsdio.com>
> Cc: Michael Roth <Michael.Roth at amd.com>
> Signed-off-by: Brijesh Singh <brijesh.singh at amd.com>
> ---
>  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



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#84776): https://edk2.groups.io/g/devel/message/84776
Mute This Topic: https://groups.io/mt/87705849/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list