From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: gregx.yeh@intel.com) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by groups.io with SMTP; Mon, 17 Jun 2019 20:28:41 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jun 2019 20:28:40 -0700 X-ExtLoop1: 1 Received: from chinghux-desk1.gar.corp.intel.com ([10.5.215.157]) by orsmga007.jf.intel.com with ESMTP; 17 Jun 2019 20:28:39 -0700 From: GregX Yeh To: devel@edk2.groups.io Cc: Dandan Bi , Ray Ni , Ted Kuo 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 Message-Id: <20190618032813.5136-1-gregx.yeh@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 https://bugzilla.tianocore.org/show_bug.cgi?id=1920 Check ConfigAccess available before call callback function. Signed-off-by: GregX Yeh Cc: Dandan Bi Cc: Ray Ni Cc: Ted Kuo --- 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