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>
This commit is contained in:
Dandan Bi
2016-10-17 14:51:37 +08:00
committed by Star Zeng
parent 2c30541a19
commit 201fbce6fb
2 changed files with 202 additions and 27 deletions

View File

@@ -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;