]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.c
Fix the return status when physical presence variable and MemoryOverwriteRequestContr...
[mirror_edk2.git] / SecurityPkg / Tcg / MemoryOverwriteControl / TcgMor.c
index def965f13853cf1acdc84998307f5ab1294c5899..a4acc14e9a883f669d322237283a287984e2af84 100644 (file)
@@ -4,7 +4,7 @@
   This driver initilize MemoryOverwriteRequestControl variable. It \r
   will clear MOR_CLEAR_MEMORY_BIT bit if it is set.\r
 \r
-Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials \r
 are licensed and made available under the terms and conditions of the BSD License \r
 which accompanies this distribution.  The full text of the license may be found at \r
@@ -35,6 +35,7 @@ OnReadyToBoot (
   IN      VOID                      *Context\r
   )\r
 {\r
+  EFI_STATUS  Status;\r
   UINTN       DataSize;\r
   \r
   if (MOR_CLEAR_MEMORY_VALUE (mMorControl) == 0x0) {\r
@@ -50,14 +51,16 @@ OnReadyToBoot (
   mMorControl &= 0xFE;  \r
 \r
   DataSize = sizeof (mMorControl);\r
-  gRT->SetVariable (\r
-         MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME, \r
-         &gEfiMemoryOverwriteControlDataGuid, \r
-         EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
-         DataSize, \r
-         &mMorControl\r
-         );\r
-\r
+  Status   = gRT->SetVariable (\r
+               MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME, \r
+               &gEfiMemoryOverwriteControlDataGuid, \r
+               EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
+               DataSize, \r
+               &mMorControl\r
+               );\r
+  if (EFI_ERROR (Status)) {\r
+    DEBUG ((EFI_D_ERROR, "TcgMor: Clear MOR_CLEAR_MEMORY_BIT failure, Status = %r\n"));\r
+  }\r
 }\r
 \r
 \r
@@ -98,7 +101,6 @@ MorDriverEntryPoint (
     // Set default value to 0\r
     //\r
     mMorControl = 0;\r
-    DEBUG ((EFI_D_INFO, "TcgMor: Create gEfiMemoryOverwriteControlDataGuid!\n"));\r
     Status = gRT->SetVariable (\r
                     MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME, \r
                     &gEfiMemoryOverwriteControlDataGuid, \r
@@ -106,8 +108,7 @@ MorDriverEntryPoint (
                     DataSize, \r
                     &mMorControl\r
                     );\r
-    ASSERT_EFI_ERROR (Status);\r
-    \r
+    DEBUG ((EFI_D_INFO, "TcgMor: Create MOR variable! Status = %r\n", Status));\r
   } else {\r
     //\r
     // Create a Ready To Boot Event and Clear the MorControl bit in the call back function.\r