public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Jeff Westfahl <jeff.westfahl@ni.com>
To: <edk2-devel@lists.01.org>
Cc: Jeff Westfahl <jeff.westfahl@ni.com>,
	Ruiyu Ni <ruiyu.ni@intel.com>,
	"Jaben Carsey" <jaben.carsey@intel.com>
Subject: [PATCH 2/3] ShellPkg/HandleParsingLib: Open LoadedImageProtocol first
Date: Thu, 4 May 2017 16:53:03 -0500	[thread overview]
Message-ID: <1493934784-30012-3-git-send-email-jeff.westfahl@ni.com> (raw)
In-Reply-To: <1493934784-30012-1-git-send-email-jeff.westfahl@ni.com>

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>
---
 .../Library/UefiHandleParsingLib/UefiHandleParsingLib.c   | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
index 2db8a3a..c96f6dd 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;
   }
 
-- 
2.7.4



  parent reply	other threads:[~2017-05-04 21:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-04 21:53 [PATCH 0/3] ShellPkg/HandleParsingLib: Show LoadedImageProtocol info Jeff Westfahl
2017-05-04 21:53 ` [PATCH 1/3] ShellPkg/HandleParsingLib: Show LoadedImageProtocol file path as text Jeff Westfahl
2017-05-04 21:53 ` Jeff Westfahl [this message]
2017-05-04 21:53 ` [PATCH 3/3] ShellPkg/HandleParsingLib: Show LoadedImageProtocol file name Jeff Westfahl
2017-05-05  2:59 ` [PATCH 0/3] ShellPkg/HandleParsingLib: Show LoadedImageProtocol info Ni, Ruiyu
2017-05-05 12:25   ` Jeff Westfahl
2017-05-05 15:49     ` Carsey, Jaben

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1493934784-30012-3-git-send-email-jeff.westfahl@ni.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox