]> git.proxmox.com Git - mirror_edk2.git/commitdiff
RestoreLockBox in DXE with Length NULL, Buffer NULL will fail to get data from Lockbo...
authorli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 25 Aug 2011 08:25:13 +0000 (08:25 +0000)
committerli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 25 Aug 2011 08:25:13 +0000 (08:25 +0000)
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

MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c

index 1f9c3b48360158be8b4bf499f0a108d0f63f1a5e..35862c62232c2847db15c46ae67e04e4546ded21 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
@@ -183,11 +183,19 @@ SmmLockBoxRestore (
   //\r
   // Restore data\r
   //\r
-  Status = RestoreLockBox (\r
-             &LockBoxParameterRestore->Guid,\r
-             (VOID *)(UINTN)LockBoxParameterRestore->Buffer,\r
-             (UINTN *)&LockBoxParameterRestore->Length\r
-             );\r
+  if ((LockBoxParameterRestore->Length == 0) && (LockBoxParameterRestore->Buffer == 0)) {\r
+    Status = RestoreLockBox (\r
+               &LockBoxParameterRestore->Guid,\r
+               NULL,\r
+               NULL\r
+               );\r
+  } else {\r
+    Status = RestoreLockBox (\r
+               &LockBoxParameterRestore->Guid,\r
+               (VOID *)(UINTN)LockBoxParameterRestore->Buffer,\r
+               (UINTN *)&LockBoxParameterRestore->Length\r
+               );\r
+  }\r
   LockBoxParameterRestore->Header.ReturnStatus = (UINT64)Status;\r
   return ;\r
 }\r