Copying and releasing each EFI_LOAD_OPTION.FilePathList under the name
DevPath is wasteful -- we only need FilePathList for a single conversion
to text. Do it directly from the EFI_LOAD_OPTION object.
This patch is not supposed to change observable behavior.
Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ryan Harkin <ryan.harkin@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19713
6f19259b-4bc3-4df7-8a09-
765794883524
UINTN LoopVar;\r
UINTN LoopVar2;\r
CHAR16 *DevPathString;\r
UINTN LoopVar;\r
UINTN LoopVar2;\r
CHAR16 *DevPathString;\r
UINTN Errors;\r
EFI_LOAD_OPTION *LoadOption;\r
CHAR16 *Description;\r
UINTN Errors;\r
EFI_LOAD_OPTION *LoadOption;\r
CHAR16 *Description;\r
for (LoopVar = 0 ; LoopVar < OrderCount ; LoopVar++) {\r
Buffer = NULL;\r
BufferSize = 0;\r
for (LoopVar = 0 ; LoopVar < OrderCount ; LoopVar++) {\r
Buffer = NULL;\r
BufferSize = 0;\r
DevPathString = NULL;\r
\r
UnicodeSPrint(VariableName, sizeof(VariableName), L"%s%04x", Op, CurrentOrder[LoopVar]);\r
DevPathString = NULL;\r
\r
UnicodeSPrint(VariableName, sizeof(VariableName), L"%s%04x", Op, CurrentOrder[LoopVar]);\r
DescriptionSize = StrSize (Description);\r
\r
if (LoadOption->FilePathListLength != 0) {\r
DescriptionSize = StrSize (Description);\r
\r
if (LoadOption->FilePathListLength != 0) {\r
- DevPath = AllocateZeroPool(LoadOption->FilePathListLength);\r
- if (DevPath != NULL) {\r
- CopyMem(DevPath, Buffer+6+DescriptionSize, LoadOption->FilePathListLength);\r
- DevPathString = ConvertDevicePathToText(DevPath, TRUE, FALSE);\r
- }\r
+ FilePathList = (UINT8 *)Description + DescriptionSize;\r
+ DevPathString = ConvertDevicePathToText(FilePathList, TRUE, FALSE);\r
}\r
ShellPrintHiiEx(\r
-1,\r
}\r
ShellPrintHiiEx(\r
-1,\r
if (Buffer != NULL) {\r
FreePool(Buffer);\r
}\r
if (Buffer != NULL) {\r
FreePool(Buffer);\r
}\r
- if (DevPath != NULL) {\r
- FreePool(DevPath);\r
- }\r
if (DevPathString != NULL) {\r
FreePool(DevPathString);\r
}\r
if (DevPathString != NULL) {\r
FreePool(DevPathString);\r
}\r