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
\r
@retval EFI_OUT_OF_RESOURCES If not enought memory to complete the operation.\r
@retval EFI_SUCCESS If function completes successfully.\r
\r
@retval EFI_OUT_OF_RESOURCES If not enought memory to complete the operation.\r
@retval EFI_SUCCESS If function completes successfully.\r
- @return Others Errors Return errors from call to gRT->GetVariable.\r
Buffer\r
);\r
ASSERT_EFI_ERROR (Status);\r
Buffer\r
);\r
ASSERT_EFI_ERROR (Status);\r
- Status = GetEfiGlobalVariable2 (L"DriverOrder", (VOID **) &DriverOrderList, &DriverOrderListSize);\r
- if (EFI_ERROR (Status) || DriverOrderList == NULL){\r
- return Status;\r
- }\r
+ GetEfiGlobalVariable2 (L"DriverOrder", (VOID **) &DriverOrderList, &DriverOrderListSize);\r
NewDriverOrderList = AllocateZeroPool (DriverOrderListSize + sizeof (UINT16));\r
ASSERT (NewDriverOrderList != NULL);\r
NewDriverOrderList = AllocateZeroPool (DriverOrderListSize + sizeof (UINT16));\r
ASSERT (NewDriverOrderList != NULL);\r
- CopyMem (NewDriverOrderList, DriverOrderList, DriverOrderListSize);\r
+ if (DriverOrderList != NULL){\r
+ CopyMem (NewDriverOrderList, DriverOrderList, DriverOrderListSize);\r
+ }\r
NewDriverOrderList[DriverOrderListSize / sizeof (UINT16)] = Index;\r
if (DriverOrderList != NULL) {\r
EfiLibDeleteVariable (L"DriverOrder", &gEfiGlobalVariableGuid);\r
NewDriverOrderList[DriverOrderListSize / sizeof (UINT16)] = Index;\r
if (DriverOrderList != NULL) {\r
EfiLibDeleteVariable (L"DriverOrder", &gEfiGlobalVariableGuid);\r
\r
@retval EFI_OUT_OF_RESOURCES If not enought memory to complete the operation.\r
@retval EFI_SUCCESS If function completes successfully.\r
\r
@retval EFI_OUT_OF_RESOURCES If not enought memory to complete the operation.\r
@retval EFI_SUCCESS If function completes successfully.\r
- @return Others Errors Return errors from call to gRT->GetVariable.\r
);\r
ASSERT_EFI_ERROR (Status);\r
\r
);\r
ASSERT_EFI_ERROR (Status);\r
\r
- Status = GetEfiGlobalVariable2 (L"BootOrder", (VOID **) &BootOrderList, &BootOrderListSize);\r
- if (EFI_ERROR (Status) || BootOrderList == NULL){\r
- return Status;\r
- }\r
+ GetEfiGlobalVariable2 (L"BootOrder", (VOID **) &BootOrderList, &BootOrderListSize);\r
NewBootOrderList = AllocateZeroPool (BootOrderListSize + sizeof (UINT16));\r
ASSERT (NewBootOrderList != NULL);\r
NewBootOrderList = AllocateZeroPool (BootOrderListSize + sizeof (UINT16));\r
ASSERT (NewBootOrderList != NULL);\r
- CopyMem (NewBootOrderList, BootOrderList, BootOrderListSize);\r
+ if (BootOrderList != NULL){\r
+ CopyMem (NewBootOrderList, BootOrderList, BootOrderListSize);\r
+ }\r
NewBootOrderList[BootOrderListSize / sizeof (UINT16)] = Index;\r
\r
if (BootOrderList != NULL) {\r
NewBootOrderList[BootOrderListSize / sizeof (UINT16)] = Index;\r
\r
if (BootOrderList != NULL) {\r