]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c
Add return status check for SetVariable.
[mirror_edk2.git] / IntelFrameworkModulePkg / Library / GenericBdsLib / BdsConsole.c
index 5a0f79bf759d842cc0a2c9a1913c511a85b17024..2add59c5ab22e2291a49ffc8efc041d1260303cc 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   BDS Lib functions which contain all the code to connect console device\r
 \r
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2011, 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
@@ -196,6 +196,7 @@ BdsLibUpdateConsoleVariable (
   IN  EFI_DEVICE_PATH_PROTOCOL  *ExclusiveDevicePath\r
   )\r
 {\r
+  EFI_STATUS                Status;\r
   EFI_DEVICE_PATH_PROTOCOL  *VarConsole;\r
   UINTN                     DevicePathSize;\r
   EFI_DEVICE_PATH_PROTOCOL  *NewDevicePath;\r
@@ -272,13 +273,14 @@ BdsLibUpdateConsoleVariable (
   //\r
   // Finally, Update the variable of the default console by NewDevicePath\r
   //\r
-  gRT->SetVariable (\r
-        ConVarName,\r
-        &gEfiGlobalVariableGuid,\r
-        Attributes,\r
-        GetDevicePathSize (NewDevicePath),\r
-        NewDevicePath\r
-        );\r
+  Status = gRT->SetVariable (\r
+                  ConVarName,\r
+                  &gEfiGlobalVariableGuid,\r
+                  Attributes,\r
+                  GetDevicePathSize (NewDevicePath),\r
+                  NewDevicePath\r
+                  );\r
+  ASSERT_EFI_ERROR (Status);\r
 \r
   if (VarConsole == NewDevicePath) {\r
     if (VarConsole != NULL) {\r