summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c
diff options
context:
space:
mode:
authorDandan Bi <dandan.bi@intel.com>2016-10-17 14:51:37 +0800
committerStar Zeng <star.zeng@intel.com>2016-10-19 11:37:52 +0800
commit201fbce6fbc69ebb53cc5b1b263059051e561e86 (patch)
tree03f316013dc41b6a92c42302c477aa29c7870830 /MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c
parent2c30541a197b2204f941bfa47a01dc4d4d57ab5a (diff)
downloadedk2-platforms-201fbce6fbc69ebb53cc5b1b263059051e561e86.tar.xz
MdeModulePkg/BMMUI: Add error handling codes
The function which handles the "Boot####", "BootOrder" ... may return failure. This patch adds the error handling codes. return the failure info to browser. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
Diffstat (limited to 'MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c')
-rw-r--r--MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c
index b65d6a5c9e..a2ae2a7736 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c
+++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c
@@ -465,7 +465,9 @@ Var_UpdateErrorOutOption (
@param OptionalData The optional load option.
@param ForceReconnect If to force reconnect.
- @retval EFI_OUT_OF_RESOURCES If not enought memory to complete the operation.
+ @retval other Contain some errors when excuting this function.See function
+ EfiBootManagerInitializeLoadOption/EfiBootManagerAddLoadOptionVariabl
+ for detail return information.
@retval EFI_SUCCESS If function completes successfully.
**/
@@ -525,8 +527,14 @@ Var_UpdateDriverOption (
OptionalDesData,
OptionalDataSize
);
- if (!EFI_ERROR (Status)){
- Status = EfiBootManagerAddLoadOptionVariable (&LoadOption,(UINTN) -1 );
+ if (EFI_ERROR (Status)){
+ return Status;
+ }
+
+ Status = EfiBootManagerAddLoadOptionVariable (&LoadOption,(UINTN) -1 );
+ if (EFI_ERROR (Status)) {
+ EfiBootManagerFreeLoadOption(&LoadOption);
+ return Status;
}
NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;
@@ -582,7 +590,9 @@ Var_UpdateDriverOption (
@param CallbackData The BMM context data.
- @retval EFI_OUT_OF_RESOURCES If not enought memory to complete the operation.
+ @retval other Contain some errors when excuting this function. See function
+ EfiBootManagerInitializeLoadOption/EfiBootManagerAddLoadOptionVariabl
+ for detail return information.
@retval EFI_SUCCESS If function completes successfully.
**/
@@ -635,8 +645,14 @@ Var_UpdateBootOption (
OptionalData,
OptionalDataSize
);
- if (!EFI_ERROR (Status)){
- Status = EfiBootManagerAddLoadOptionVariable (&LoadOption,(UINTN) -1 );
+ if (EFI_ERROR (Status)){
+ return Status;
+ }
+
+ Status = EfiBootManagerAddLoadOptionVariable (&LoadOption,(UINTN) -1 );
+ if (EFI_ERROR (Status)) {
+ EfiBootManagerFreeLoadOption(&LoadOption);
+ return Status;
}
NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;