summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhiguang Liu <zhiguang.liu@intel.com>2024-04-24 15:24:32 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-05-30 01:57:35 +0000
commitb40c64ec25986d36e1fd02304daa9d72ac863da6 (patch)
tree46406d2a07665106f727a2cfd017e7d7d1d4c18a
parent79655e27686031326eda3ea290225db6aea3b53f (diff)
downloadedk2-b40c64ec25986d36e1fd02304daa9d72ac863da6.tar.gz
edk2-b40c64ec25986d36e1fd02304daa9d72ac863da6.tar.bz2
edk2-b40c64ec25986d36e1fd02304daa9d72ac863da6.zip
MdeModulePkg/SMM: Initialize 'WillReturn' variable
The local variable 'WillReturn' was being used without prior initialization in some code paths. This patch ensures that 'WillReturn' is properly initialized to prevent undefined behavior. Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
-rw-r--r--MdeModulePkg/Core/PiSmmCore/Smi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/MdeModulePkg/Core/PiSmmCore/Smi.c b/MdeModulePkg/Core/PiSmmCore/Smi.c
index a84a1f48d3..6b56fa5f69 100644
--- a/MdeModulePkg/Core/PiSmmCore/Smi.c
+++ b/MdeModulePkg/Core/PiSmmCore/Smi.c
@@ -152,6 +152,7 @@ SmiManage (
PERF_FUNCTION_BEGIN ();
mSmiManageCallingDepth++;
+ WillReturn = FALSE;
Status = EFI_NOT_FOUND;
ReturnStatus = Status;
if (HandlerType == NULL) {