X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FLibrary%2FBootMaintenanceManagerUiLib%2FUpdatePage.c;h=9e79826a6afaaea4e715774da6ae18087ad421a1;hp=13a29db9f4e4728df07af6bb9b23713edecb103a;hb=a91f1a0e88d07dd3817737f9886bc247cc737a4f;hpb=ae9026ddfa063f23ba3c7c57e3d5d6c9e0de8220
diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c
index 13a29db9f4..9e79826a6a 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c
+++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c
@@ -1,7 +1,7 @@
/** @file
Dynamically update the pages.
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -1020,17 +1020,19 @@ UpdateOptionPage(
CHAR16 *String;
EFI_STRING_ID StringToken;
+ String = NULL;
+
if (DevicePath != NULL){
String = ExtractFileNameFromDevicePath(DevicePath);
- StringToken = HiiSetString (CallbackData->BmmHiiHandle, 0, String, NULL);
- FreePool(String);
- } else {
+ }
+ if (String == NULL) {
String = HiiGetString (CallbackData->BmmHiiHandle, STRING_TOKEN (STR_NULL_STRING), NULL);
ASSERT (String != NULL);
- StringToken = HiiSetString (CallbackData->BmmHiiHandle, 0, String, NULL);
- FreePool (String);
}
+ StringToken = HiiSetString (CallbackData->BmmHiiHandle, 0, String, NULL);
+ FreePool (String);
+
if(FormId == FORM_BOOT_ADD_ID){
if (!CallbackData->BmmFakeNvData.BootOptionChanged) {
ZeroMem (CallbackData->BmmFakeNvData.BootOptionalData, sizeof (CallbackData->BmmFakeNvData.BootOptionalData));