summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
fed5f44)
This is caused by my last commit,the LoadOption may
not initialize when call FreePool, and after investigation,
find that we can delete the LoadOption variable, this patch
is to fix this issue.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
UINTN Index;\r
UINT16 BootString[10];\r
UINT8 *LoadOptionFromVar;\r
UINTN Index;\r
UINT16 BootString[10];\r
UINT8 *LoadOptionFromVar;\r
UINTN BootOptionSize;\r
BOOLEAN BootNextFlag;\r
UINT16 *BootOrderList;\r
UINTN BootOptionSize;\r
BOOLEAN BootNextFlag;\r
UINT16 *BootOrderList;\r
- LoadOption = AllocateZeroPool (BootOptionSize);\r
- if (LoadOption == NULL) {\r
- continue;\r
- }\r
-\r
- CopyMem (LoadOption, LoadOptionFromVar, BootOptionSize);\r
- FreePool (LoadOptionFromVar);\r
-\r
if (BootNext != NULL) {\r
BootNextFlag = (BOOLEAN) (*BootNext == BootOrderList[Index]);\r
} else {\r
if (BootNext != NULL) {\r
BootNextFlag = (BOOLEAN) (*BootNext == BootOrderList[Index]);\r
} else {\r
\r
NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;\r
\r
\r
NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;\r
\r
- LoadOptionPtr = LoadOption;\r
- LoadOptionEnd = LoadOption + BootOptionSize;\r
+ LoadOptionPtr = LoadOptionFromVar;\r
+ LoadOptionEnd = LoadOptionFromVar + BootOptionSize;\r
\r
NewMenuEntry->OptionNumber = BootOrderList[Index];\r
NewLoadContext->Deleted = FALSE;\r
\r
NewMenuEntry->OptionNumber = BootOrderList[Index];\r
NewLoadContext->Deleted = FALSE;\r
//\r
// Is a Legacy Device?\r
//\r
//\r
// Is a Legacy Device?\r
//\r
- Ptr = (UINT8 *) LoadOption;\r
+ Ptr = (UINT8 *) LoadOptionFromVar;\r
\r
//\r
// Attribute = *(UINT32 *)Ptr;\r
\r
//\r
// Attribute = *(UINT32 *)Ptr;\r
\r
InsertTailList (&BootOptionMenu.Head, &NewMenuEntry->Link);\r
MenuCount++;\r
\r
InsertTailList (&BootOptionMenu.Head, &NewMenuEntry->Link);\r
MenuCount++;\r
+ FreePool (LoadOptionFromVar);\r
}\r
EfiBootManagerFreeLoadOptions (BootOption, BootOptionCount);\r
\r
}\r
EfiBootManagerFreeLoadOptions (BootOption, BootOptionCount);\r
\r
FreePool (BootOrderList);\r
}\r
\r
FreePool (BootOrderList);\r
}\r
\r
- FreePool(LoadOption);\r
BootOptionMenu.MenuNumber = MenuCount;\r
return EFI_SUCCESS;\r
}\r
BootOptionMenu.MenuNumber = MenuCount;\r
return EFI_SUCCESS;\r
}\r
UINTN Index;\r
UINT16 DriverString[12];\r
UINT8 *LoadOptionFromVar;\r
UINTN Index;\r
UINT16 DriverString[12];\r
UINT8 *LoadOptionFromVar;\r
UINTN DriverOptionSize;\r
\r
UINT16 *DriverOrderList;\r
UINTN DriverOptionSize;\r
\r
UINT16 *DriverOrderList;\r
- LoadOption = AllocateZeroPool (DriverOptionSize);\r
- if (LoadOption == NULL) {\r
- continue;\r
- }\r
-\r
- CopyMem (LoadOption, LoadOptionFromVar, DriverOptionSize);\r
- FreePool (LoadOptionFromVar);\r
\r
NewMenuEntry = BOpt_CreateMenuEntry (BM_LOAD_CONTEXT_SELECT);\r
if (NULL == NewMenuEntry) {\r
\r
NewMenuEntry = BOpt_CreateMenuEntry (BM_LOAD_CONTEXT_SELECT);\r
if (NULL == NewMenuEntry) {\r
}\r
\r
NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;\r
}\r
\r
NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;\r
- LoadOptionPtr = LoadOption;\r
- LoadOptionEnd = LoadOption + DriverOptionSize;\r
+ LoadOptionPtr = LoadOptionFromVar;\r
+ LoadOptionEnd = LoadOptionFromVar + DriverOptionSize;\r
NewMenuEntry->OptionNumber = DriverOrderList[Index];\r
NewLoadContext->Deleted = FALSE;\r
NewLoadContext->IsLegacy = FALSE;\r
NewMenuEntry->OptionNumber = DriverOrderList[Index];\r
NewLoadContext->Deleted = FALSE;\r
NewLoadContext->IsLegacy = FALSE;\r
}\r
\r
InsertTailList (&DriverOptionMenu.Head, &NewMenuEntry->Link);\r
}\r
\r
InsertTailList (&DriverOptionMenu.Head, &NewMenuEntry->Link);\r
+ FreePool (LoadOptionFromVar);\r
\r
}\r
\r
if (DriverOrderList != NULL) {\r
FreePool (DriverOrderList);\r
}\r
\r
}\r
\r
if (DriverOrderList != NULL) {\r
FreePool (DriverOrderList);\r
}\r
- FreePool(LoadOption);\r
DriverOptionMenu.MenuNumber = Index;\r
return EFI_SUCCESS;\r
\r
DriverOptionMenu.MenuNumber = Index;\r
return EFI_SUCCESS;\r
\r