Reviewed-by: Jiewen Yao <jiewen....@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael
> Kubacki
> Sent: Friday, March 26, 2021 8:42 AM
> To: devel@edk2.groups.io
> Cc: Yao, Jiewen <jiewen....@intel.com>; Wang, Jian J <jian.j.w...@intel.com>;
> Zhang, Qi1 <qi1.zh...@intel.com>; Kumar, Rahul1 <rahul1.ku...@intel.com>;
> Kun Qin <ku...@outlook.com>
> Subject: [edk2-devel] [PATCH v1 1/1] SecurityPkg/Tcg2Smm: Initialize local
> Status variable
> 
> From: Michael Kubacki <michael.kuba...@microsoft.com>
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3277
> 
> Initializes the Status variable in TcgMmReadyToLock().
> 
> Fixes a Clang build failure:
> Tcg2Smm.c - SecurityPkg\Tcg\Tcg2Smm\Tcg2Smm.c:254:7: error:
> variable 'Status' is used uninitialized whenever 'if'
> condition is false [-Werror,-Wsometimes-uninitialized]
> 
> Cc: Jiewen Yao <jiewen....@intel.com>
> Cc: Jian J Wang <jian.j.w...@intel.com>
> Cc: Qi Zhang <qi1.zh...@intel.com>
> Cc: Rahul Kumar <rahul1.ku...@intel.com>
> Cc: Kun Qin <ku...@outlook.com>
> Signed-off-by: Michael Kubacki <michael.kuba...@microsoft.com>
> ---
>  SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
> b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
> index 589c08794bcf..f49eccb0bdf4 100644
> --- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
> +++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
> @@ -253,6 +253,8 @@ TcgMmReadyToLock (
>  {
>    EFI_STATUS Status;
> 
> +  Status = EFI_SUCCESS;
> +
>    if (mReadyToLockHandle != NULL) {
>      Status = gMmst->MmiHandlerUnRegister (mReadyToLockHandle);
>      mReadyToLockHandle = NULL;
> --
> 2.28.0.windows.1
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#73301): https://edk2.groups.io/g/devel/message/73301
> Mute This Topic: https://groups.io/mt/81617668/1772286
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [jiewen....@intel.com]
> -=-=-=-=-=-=
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#73304): https://edk2.groups.io/g/devel/message/73304
Mute This Topic: https://groups.io/mt/81617668/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to