summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c
diff options
context:
space:
mode:
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;