Revision: 18220
http://sourceforge.net/p/edk2/code/18220
Author: dandanbi
Date: 2015-08-14 01:06:48 +0000 (Fri, 14 Aug 2015)
Log Message:
-----------
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 <[email protected]>
Reviewed-by: Qiu Shumin <[email protected]>
Reviewed-by: Eric Dong <[email protected]>
Modified Paths:
--------------
trunk/edk2/MdeModulePkg/Application/UiApp/BootMaint/Variable.c
Modified: trunk/edk2/MdeModulePkg/Application/UiApp/BootMaint/Variable.c
===================================================================
--- trunk/edk2/MdeModulePkg/Application/UiApp/BootMaint/Variable.c
2015-08-13 08:24:17 UTC (rev 18219)
+++ trunk/edk2/MdeModulePkg/Application/UiApp/BootMaint/Variable.c
2015-08-14 01:06:48 UTC (rev 18220)
@@ -524,7 +524,6 @@
@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 @@
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 @@
@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 @@
);
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) {
------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits