diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2021-04-07 02:12:07 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-04-13 01:57:43 +0000 |
commit | 54211ab10fcd8532b49f4024ebdb601a8eb07e3e (patch) | |
tree | fe860b4f051c972aa7ab5d32f044d80eecbff55e /SecurityPkg/Tcg | |
parent | f8e6bcb6e7c350eb7be887dfdb5aad43cd6373af (diff) | |
download | edk2-54211ab10fcd8532b49f4024ebdb601a8eb07e3e.tar.gz edk2-54211ab10fcd8532b49f4024ebdb601a8eb07e3e.tar.bz2 edk2-54211ab10fcd8532b49f4024ebdb601a8eb07e3e.zip |
SecurityPkg/Tcg2Smm: Initialize local Status variable
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]
Initializing this variable is required to address a practical
scenario in which the return value of TcgMmReadyToLock() is
undefined based on conditional evaluation in the function.
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Qi Zhang <qi1.zhang@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Kun Qin <kun.q@outlook.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'SecurityPkg/Tcg')
-rw-r--r-- | SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c index 589c08794b..f49eccb0bd 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;
|