mirror of https://github.com/acidanthera/audk.git
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:
parent
a6daab1f6c
commit
a9ae5b37bf
|
@ -217,7 +217,10 @@ SmmLockBoxRestore (
|
||||||
(VOID *)(UINTN)TempLockBoxParameterRestore.Buffer,
|
(VOID *)(UINTN)TempLockBoxParameterRestore.Buffer,
|
||||||
(UINTN *)&TempLockBoxParameterRestore.Length
|
(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;
|
LockBoxParameterRestore->Length = TempLockBoxParameterRestore.Length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue