diff options
author | Dandan Bi <dandan.bi@intel.com> | 2015-08-14 01:06:48 +0000 |
---|---|---|
committer | dandanbi <dandanbi@Edk2> | 2015-08-14 01:06:48 +0000 |
commit | d6da3fb0b2ddeb4a76cb49de97594fc53d70f67d (patch) | |
tree | 96998bec28795027f6d6c0447142eec1dbdb9736 /MdeModulePkg/Application | |
parent | 1abfa4ce4835639c66ae82cc0d72cffcf3f28b6b (diff) | |
download | edk2-platforms-d6da3fb0b2ddeb4a76cb49de97594fc53d70f67d.tar.xz |
MdeModulePkg:Fix the issue that Commit changes and Exit fail when add driver option
When add driver option using file,input the description and then commit changes and exit,
it doesn't work.it caused by the commit 18216.When variable DriverOrderList in Variable.c
is NULL,it also need do the follow path,shouldn't return.Now change the code.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18220 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Application')
-rw-r--r-- | MdeModulePkg/Application/UiApp/BootMaint/Variable.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/MdeModulePkg/Application/UiApp/BootMaint/Variable.c b/MdeModulePkg/Application/UiApp/BootMaint/Variable.c index 8c10540854..2b594fcbd4 100644 --- a/MdeModulePkg/Application/UiApp/BootMaint/Variable.c +++ b/MdeModulePkg/Application/UiApp/BootMaint/Variable.c @@ -524,7 +524,6 @@ Var_UpdateErrorOutOption ( @retval EFI_OUT_OF_RESOURCES If not enought memory to complete the operation.
@retval EFI_SUCCESS If function completes successfully.
- @return Others Errors Return errors from call to gRT->GetVariable.
**/
EFI_STATUS
@@ -660,13 +659,12 @@ Var_UpdateDriverOption ( Buffer
);
ASSERT_EFI_ERROR (Status);
- Status = GetEfiGlobalVariable2 (L"DriverOrder", (VOID **) &DriverOrderList, &DriverOrderListSize);
- if (EFI_ERROR (Status) || DriverOrderList == NULL){
- return Status;
- }
+ GetEfiGlobalVariable2 (L"DriverOrder", (VOID **) &DriverOrderList, &DriverOrderListSize);
NewDriverOrderList = AllocateZeroPool (DriverOrderListSize + sizeof (UINT16));
ASSERT (NewDriverOrderList != NULL);
- CopyMem (NewDriverOrderList, DriverOrderList, DriverOrderListSize);
+ if (DriverOrderList != NULL){
+ CopyMem (NewDriverOrderList, DriverOrderList, DriverOrderListSize);
+ }
NewDriverOrderList[DriverOrderListSize / sizeof (UINT16)] = Index;
if (DriverOrderList != NULL) {
EfiLibDeleteVariable (L"DriverOrder", &gEfiGlobalVariableGuid);
@@ -704,7 +702,6 @@ Var_UpdateDriverOption ( @retval EFI_OUT_OF_RESOURCES If not enought memory to complete the operation.
@retval EFI_SUCCESS If function completes successfully.
- @return Others Errors Return errors from call to gRT->GetVariable.
**/
EFI_STATUS
@@ -829,13 +826,12 @@ Var_UpdateBootOption ( );
ASSERT_EFI_ERROR (Status);
- Status = GetEfiGlobalVariable2 (L"BootOrder", (VOID **) &BootOrderList, &BootOrderListSize);
- if (EFI_ERROR (Status) || BootOrderList == NULL){
- return Status;
- }
+ GetEfiGlobalVariable2 (L"BootOrder", (VOID **) &BootOrderList, &BootOrderListSize);
NewBootOrderList = AllocateZeroPool (BootOrderListSize + sizeof (UINT16));
ASSERT (NewBootOrderList != NULL);
- CopyMem (NewBootOrderList, BootOrderList, BootOrderListSize);
+ if (BootOrderList != NULL){
+ CopyMem (NewBootOrderList, BootOrderList, BootOrderListSize);
+ }
NewBootOrderList[BootOrderListSize / sizeof (UINT16)] = Index;
if (BootOrderList != NULL) {
|