summaryrefslogtreecommitdiff
path: root/Core/ShellPkg/Library
diff options
context:
space:
mode:
authorJeff Westfahl <jeff.westfahl@ni.com>2017-05-05 05:53:03 +0800
committerGuo Mang <mang.guo@intel.com>2017-07-12 11:24:43 +0800
commite6e5443901d90594f5b6000ad7d8181e0fd03f26 (patch)
tree3e412346e4ec59a6782848b13f4ebda85ef13c1c /Core/ShellPkg/Library
parent7cc9261a8a930244e9478014348568d5304f4759 (diff)
downloadedk2-platforms-e6e5443901d90594f5b6000ad7d8181e0fd03f26.tar.xz
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 'Core/ShellPkg/Library')
-rw-r--r--Core/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/Core/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c b/Core/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
index 2db8a3a2cf..c96f6dd157 100644
--- a/Core/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
+++ b/Core/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;
}