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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user