summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library
diff options
context:
space:
mode:
authorJeff Westfahl <jeff.westfahl@ni.com>2017-05-05 05:53:03 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2017-05-11 19:17:16 +0800
commitb6adb111639ffb76428798063553ed7d6cf7c25d (patch)
treeb212147ed6f7c6d4604023055b7bcd8fb29d6856 /ShellPkg/Library
parent9107fb6f5561ce91e372d31846da08c7072cb209 (diff)
downloadedk2-b6adb111639ffb76428798063553ed7d6cf7c25d.tar.gz
edk2-b6adb111639ffb76428798063553ed7d6cf7c25d.tar.bz2
edk2-b6adb111639ffb76428798063553ed7d6cf7c25d.zip
ShellPkg/HandleParsingLib: Open LoadedImageProtocol first
This patch changes the order of operations to make sure we can open the LoadedImageProtocol before getting the format string. This should not affect functionality, and makes the next patch easier to review. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Westfahl <jeff.westfahl@ni.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit bbb212afa0f8e33e0b686a1b6ffd85d353eed83d)
Diffstat (limited to 'ShellPkg/Library')
-rw-r--r--ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
index 2db8a3a2cf..c96f6dd157 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
@@ -177,13 +177,6 @@ LoadedImageProtocolDumpInformation(
return (CatSPrint(NULL, L"LoadedImage"));
}
- HandleParsingHiiInit();
-
- Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_LI_DUMP_MAIN), NULL);
- if (Temp == NULL) {
- return NULL;
- }
-
Status = gBS->OpenProtocol (
TheHandle,
&gEfiLoadedImageProtocolGuid,
@@ -194,7 +187,13 @@ LoadedImageProtocolDumpInformation(
);
if (EFI_ERROR (Status)) {
- SHELL_FREE_NON_NULL (Temp);
+ return NULL;
+ }
+
+ HandleParsingHiiInit();
+
+ Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_LI_DUMP_MAIN), NULL);
+ if (Temp == NULL) {
return NULL;
}