summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/LockBox
diff options
context:
space:
mode:
authorli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>2011-08-25 08:25:13 +0000
committerli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>2011-08-25 08:25:13 +0000
commit1476a2576160018e56f628fe85c3d23b2db959a8 (patch)
tree9534f96f3650920c8b29b5daba37d52d836c9602 /MdeModulePkg/Universal/LockBox
parentf6c014fb14b19ebbccfb7725df28178e34602e05 (diff)
downloadedk2-1476a2576160018e56f628fe85c3d23b2db959a8.tar.gz
edk2-1476a2576160018e56f628fe85c3d23b2db959a8.tar.bz2
edk2-1476a2576160018e56f628fe85c3d23b2db959a8.zip
RestoreLockBox in DXE with Length NULL, Buffer NULL will fail to get data from Lockbox. Fix this issue.
Signed-off-by: li-elvin Reviewed-by: jyao1 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12208 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/LockBox')
-rw-r--r--MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c b/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c
index 1f9c3b4836..35862c6223 100644
--- a/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c
+++ b/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions
@@ -183,11 +183,19 @@ SmmLockBoxRestore (
//
// Restore data
//
- Status = RestoreLockBox (
- &LockBoxParameterRestore->Guid,
- (VOID *)(UINTN)LockBoxParameterRestore->Buffer,
- (UINTN *)&LockBoxParameterRestore->Length
- );
+ if ((LockBoxParameterRestore->Length == 0) && (LockBoxParameterRestore->Buffer == 0)) {
+ Status = RestoreLockBox (
+ &LockBoxParameterRestore->Guid,
+ NULL,
+ NULL
+ );
+ } else {
+ Status = RestoreLockBox (
+ &LockBoxParameterRestore->Guid,
+ (VOID *)(UINTN)LockBoxParameterRestore->Buffer,
+ (UINTN *)&LockBoxParameterRestore->Length
+ );
+ }
LockBoxParameterRestore->Header.ReturnStatus = (UINT64)Status;
return ;
}