Re: [edk2] [Patch 1/2] BootManagerLib: Check the pointer to avoid use NULL pointer.

2015-12-15 Thread Gao, Liming
Eric:
  Could you check its return status first, then check its return value? 

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Eric Dong
Sent: Tuesday, December 15, 2015 9:57 AM
To: edk2-devel@lists.01.org
Subject: [edk2] [Patch 1/2] BootManagerLib: Check the pointer to avoid use NULL 
pointer.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.d...@intel.com>
---
 MdeModulePkg/Library/BootManagerLib/BootManager.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MdeModulePkg/Library/BootManagerLib/BootManager.c 
b/MdeModulePkg/Library/BootManagerLib/BootManager.c
index cfeedeb..dd9838e 100644
--- a/MdeModulePkg/Library/BootManagerLib/BootManager.c
+++ b/MdeModulePkg/Library/BootManagerLib/BootManager.c
@@ -325,10 +325,11 @@ GroupMultipleLegacyBootOption4SameType (
   EFI_BOOT_MANAGER_LOAD_OPTION BootOption;
 
   SetMem (DeviceTypeIndex, sizeof (DeviceTypeIndex), 0xff);
 
   GetEfiGlobalVariable2 (L"BootOrder", (VOID **) , );
+  ASSERT (BootOrder != NULL);
 
   for (Index = 0; Index < BootOrderSize / sizeof (UINT16); Index++) {
 UnicodeSPrint (OptionName, sizeof (OptionName), L"Boot%04x", 
BootOrder[Index]);
 Status = EfiBootManagerVariableToLoadOption (OptionName, );
 ASSERT_EFI_ERROR (Status);
-- 
1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch 1/2] BootManagerLib: Check the pointer to avoid use NULL pointer.

2015-12-14 Thread Eric Dong
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong 
---
 MdeModulePkg/Library/BootManagerLib/BootManager.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MdeModulePkg/Library/BootManagerLib/BootManager.c 
b/MdeModulePkg/Library/BootManagerLib/BootManager.c
index cfeedeb..dd9838e 100644
--- a/MdeModulePkg/Library/BootManagerLib/BootManager.c
+++ b/MdeModulePkg/Library/BootManagerLib/BootManager.c
@@ -325,10 +325,11 @@ GroupMultipleLegacyBootOption4SameType (
   EFI_BOOT_MANAGER_LOAD_OPTION BootOption;
 
   SetMem (DeviceTypeIndex, sizeof (DeviceTypeIndex), 0xff);
 
   GetEfiGlobalVariable2 (L"BootOrder", (VOID **) , );
+  ASSERT (BootOrder != NULL);
 
   for (Index = 0; Index < BootOrderSize / sizeof (UINT16); Index++) {
 UnicodeSPrint (OptionName, sizeof (OptionName), L"Boot%04x", 
BootOrder[Index]);
 Status = EfiBootManagerVariableToLoadOption (OptionName, );
 ASSERT_EFI_ERROR (Status);
-- 
1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel