]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Check the Config access protocol before use it.
authorEric Dong <eric.dong@intel.com>
Fri, 21 Feb 2014 06:27:05 +0000 (06:27 +0000)
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 21 Feb 2014 06:27:05 +0000 (06:27 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15251 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
MdeModulePkg/Universal/SetupBrowserDxe/Setup.c

index 488087e01132a50e9936bc59280074057cc5b713..b3a3d237614c661d2439fd5b8e566ecbd6f2bb79 100644 (file)
@@ -2294,8 +2294,8 @@ ProcessRetrieveForQuestion (
 \r
   Status                = EFI_SUCCESS;\r
   ActionRequest         = EFI_BROWSER_ACTION_REQUEST_NONE;\r
-    \r
-  if ((Statement->QuestionFlags & EFI_IFR_FLAG_CALLBACK) != EFI_IFR_FLAG_CALLBACK) {\r
+\r
+  if (((Statement->QuestionFlags & EFI_IFR_FLAG_CALLBACK) != EFI_IFR_FLAG_CALLBACK) || ConfigAccess == NULL) {\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
@@ -2433,8 +2433,7 @@ SetupBrowser (
     // for each question with callback flag.\r
     // New form may be the first form, or the different form after another form close.\r
     //\r
-    if ((ConfigAccess != NULL) &&\r
-        ((Selection->Handle != mCurrentHiiHandle) ||\r
+    if (((Selection->Handle != mCurrentHiiHandle) ||\r
         (!CompareGuid (&Selection->FormSetGuid, &mCurrentFormSetGuid)) ||\r
         (Selection->FormId != mCurrentFormId))) {\r
       //\r
@@ -2444,18 +2443,20 @@ SetupBrowser (
       CopyGuid (&mCurrentFormSetGuid, &Selection->FormSetGuid);\r
       mCurrentFormId      = Selection->FormId;\r
 \r
-      Status = ProcessCallBackFunction (Selection, gCurrentSelection->FormSet, Selection->Form, NULL, EFI_BROWSER_ACTION_FORM_OPEN, FALSE);\r
-      if (EFI_ERROR (Status)) {\r
-        goto Done;\r
-      }\r
+      if (ConfigAccess != NULL) {\r
+        Status = ProcessCallBackFunction (Selection, gCurrentSelection->FormSet, Selection->Form, NULL, EFI_BROWSER_ACTION_FORM_OPEN, FALSE);\r
+        if (EFI_ERROR (Status)) {\r
+          goto Done;\r
+        }\r
 \r
-      //\r
-      // IFR is updated during callback of open form, force to reparse the IFR binary\r
-      //\r
-      if (mHiiPackageListUpdated) {\r
-        Selection->Action = UI_ACTION_REFRESH_FORMSET;\r
-        mHiiPackageListUpdated = FALSE;\r
-        break;\r
+        //\r
+        // IFR is updated during callback of open form, force to reparse the IFR binary\r
+        //\r
+        if (mHiiPackageListUpdated) {\r
+          Selection->Action = UI_ACTION_REFRESH_FORMSET;\r
+          mHiiPackageListUpdated = FALSE;\r
+          break;\r
+        }\r
       }\r
     }\r
 \r
index 5ce0b84ed6bc53290a0120a7cffc34d38566c026..f86f369ff28c7c27b257db6cdbf3d0f89ebb0328 100644 (file)
@@ -2132,6 +2132,10 @@ SendDiscardInfoToDriver (
   EFI_IFR_TYPE_VALUE          *TypeValue;\r
   EFI_BROWSER_ACTION_REQUEST  ActionRequest;\r
 \r
+  if (FormSet->ConfigAccess == NULL) {\r
+    return;\r
+  }\r
+\r
   Link = GetFirstNode (&Form->StatementListHead);\r
   while (!IsNull (&Form->StatementListHead, Link)) {\r
     Question = FORM_BROWSER_STATEMENT_FROM_LINK (Link);\r