diff options
author | Star Zeng <star.zeng@intel.com> | 2018-08-13 16:50:37 +0800 |
---|---|---|
committer | Star Zeng <star.zeng@intel.com> | 2018-08-16 09:02:14 +0800 |
commit | a9ae5b37bf5c7a3accbd2a513c354c4467547a05 (patch) | |
tree | 5fd8ab5df42085ad4f09cb1261d4d037dca9e7e4 | |
parent | a6daab1f6cb836e4147324bb85fc17930be14e87 (diff) | |
download | edk2-a9ae5b37bf5c7a3accbd2a513c354c4467547a05.tar.gz edk2-a9ae5b37bf5c7a3accbd2a513c354c4467547a05.tar.bz2 edk2-a9ae5b37bf5c7a3accbd2a513c354c4467547a05.zip |
MdeModulePkg SmmLockBox: Return actual data length in SmmLockBoxRestore
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1082
Current code only returns actual data length in case of return status
buffer too small.
If caller provided a buffer that's large enough to restore data from
lock box, actual data length is not returned. It needs to be updated
in case of return status as success as well.
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Anbazhagan Baraneedharan <anbazhagan@hp.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
-rw-r--r-- | MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c b/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c index 28d5180e01..5a11743cb9 100644 --- a/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c +++ b/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c @@ -217,7 +217,10 @@ SmmLockBoxRestore ( (VOID *)(UINTN)TempLockBoxParameterRestore.Buffer,
(UINTN *)&TempLockBoxParameterRestore.Length
);
- if (Status == EFI_BUFFER_TOO_SMALL) {
+ if ((Status == EFI_BUFFER_TOO_SMALL) || (Status == EFI_SUCCESS)) {
+ //
+ // Return the actual Length value.
+ //
LockBoxParameterRestore->Length = TempLockBoxParameterRestore.Length;
}
}
|