diff options
author | xli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-05-21 07:40:24 +0000 |
---|---|---|
committer | xli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-05-21 07:40:24 +0000 |
commit | ce5fad41516804f34d52ebb27808255e1263fd0e (patch) | |
tree | f8becb5cb1aa0cac7903a53a71114b67b9a11d96 /IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr | |
parent | 97ada49f3181ec678dddd25a35437164049793da (diff) | |
download | edk2-platforms-ce5fad41516804f34d52ebb27808255e1263fd0e.tar.xz |
For BdsDxe module,
1. Fix the risk that local variable is pointed by global pointer, which may be used outside the variable scope.
2. Add more checking for pointers.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10536 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr')
-rw-r--r-- | IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c index 01ff5f88ad..da291000bc 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c @@ -16,7 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. UINT16 mKeyInput;
EFI_GUID mBootManagerGuid = BOOT_MANAGER_FORMSET_GUID;
-LIST_ENTRY *mBootOptionsList;
+LIST_ENTRY mBootOptionsList;
BDS_COMMON_OPTION *gOption;
HII_VENDOR_DEVICE_PATH mBootManagerHiiVendorDevicePath = {
@@ -97,7 +97,7 @@ BootManagerCallback ( //
KeyCount = 0;
- for (Link = mBootOptionsList->ForwardLink; Link != mBootOptionsList; Link = Link->ForwardLink) {
+ for (Link = GetFirstNode (&mBootOptionsList); !IsNull (&mBootOptionsList, Link); Link = GetNextNode (&mBootOptionsList, Link)) {
Option = CR (Link, BDS_COMMON_OPTION, Link, BDS_LOAD_OPTION_SIGNATURE);
KeyCount++;
@@ -190,7 +190,6 @@ CallBootManager ( UINTN ExitDataSize;
EFI_STRING_ID Token;
EFI_INPUT_KEY Key;
- LIST_ENTRY BdsBootOptionList;
CHAR16 *HelpString;
EFI_STRING_ID HelpToken;
UINT16 *TempStr;
@@ -203,7 +202,7 @@ CallBootManager ( EFI_IFR_GUID_LABEL *EndLabel;
gOption = NULL;
- InitializeListHead (&BdsBootOptionList);
+ InitializeListHead (&mBootOptionsList);
//
// Connect all prior to entering the platform setup menu.
@@ -212,14 +211,8 @@ CallBootManager ( BdsLibConnectAllDriversToAllControllers ();
gConnectAllHappened = TRUE;
}
- //
- // BugBug: Here we can not remove the legacy refresh macro, so we need
- // get the boot order every time from "BootOrder" variable.
- // Recreate the boot option list base on the BootOrder variable
- //
- BdsLibEnumerateAllBootOption (&BdsBootOptionList);
- mBootOptionsList = &BdsBootOptionList;
+ BdsLibEnumerateAllBootOption (&mBootOptionsList);
HiiHandle = gBootManagerPrivate.HiiHandle;
@@ -248,7 +241,7 @@ CallBootManager ( mKeyInput = 0;
- for (Link = BdsBootOptionList.ForwardLink; Link != &BdsBootOptionList; Link = Link->ForwardLink) {
+ for (Link = GetFirstNode (&mBootOptionsList); !IsNull (&mBootOptionsList, Link); Link = GetNextNode (&mBootOptionsList, Link)) {
Option = CR (Link, BDS_COMMON_OPTION, Link, BDS_LOAD_OPTION_SIGNATURE);
//
|