public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: GregX Yeh <gregx.yeh@intel.com>
To: devel@edk2.groups.io
Cc: Dandan Bi <dandan.bi@intel.com>, Ray Ni <ray.ni@intel.com>,
	Ted Kuo <ted.kuo@intel.com>
Subject: [PATCH] MdeModulePkg:Platform exception when callback function was destroyed by unconnected controller in setup browser
Date: Tue, 18 Jun 2019 11:28:13 +0800	[thread overview]
Message-ID: <20190618032813.5136-1-gregx.yeh@intel.com> (raw)

https://bugzilla.tianocore.org/show_bug.cgi?id=1920
Check ConfigAccess available before call callback function.

Signed-off-by: GregX Yeh <gregx.yeh@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Ted Kuo <ted.kuo@intel.com>
---
 MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
index d7927725b2..a613ab350c 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
@@ -1958,6 +1958,23 @@ ProcessCallBackFunction (
   if (ConfigAccess == NULL) {
     return EFI_SUCCESS;
   }
+//
+// Check ConfigAccess available.
+//
+  Status = gBS->HandleProtocol (
+                  FormSet->DriverHandle,
+                  &gEfiHiiConfigAccessProtocolGuid,
+                  (VOID **) &FormSet->ConfigAccess
+                  );
+  if (EFI_ERROR (Status)) {
+    //
+    // Configuration Driver don't attach ConfigAccess protocol to its HII package
+    // list, then there will be no configuration action required.
+    // Or the ConfigAccess protocol has been uninstalled.
+    //
+    FormSet->ConfigAccess = NULL;
+    return EFI_SUCCESS;
+  }
 
   Link = GetFirstNode (&Form->StatementListHead);
   while (!IsNull (&Form->StatementListHead, Link)) {
-- 
2.16.2.windows.1


                 reply	other threads:[~2019-06-18  3:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20190618032813.5136-1-gregx.yeh@intel.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