diff options
author | Dandan Bi <dandan.bi@intel.com> | 2016-04-26 19:52:02 +0800 |
---|---|---|
committer | Star Zeng <star.zeng@intel.com> | 2016-05-06 10:41:19 +0800 |
commit | fdd530d61b06e8947613781a7106707161371b63 (patch) | |
tree | 470eed0f6ec8ecfdb423931eadc6b6f61292aee5 | |
parent | 8066b27e86f3ba4617daf7aedd73b0d8290ab5eb (diff) | |
download | edk2-platforms-fdd530d61b06e8947613781a7106707161371b63.tar.xz |
MdeModulePkg/SetupBrowser: Call submit callback function when no failure
In current code will always call submit callback function,
but we should call submit callback function when has no failure
in the submit action. This patch to fix this issues.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
-rw-r--r-- | MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c index a437674bdc..23094f8145 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -3182,6 +3182,9 @@ SubmitForForm ( EFI_STRING Progress;
BROWSER_STORAGE *Storage;
FORM_BROWSER_CONFIG_REQUEST *ConfigInfo;
+ BOOLEAN SubmitFormFail;
+
+ SubmitFormFail = FALSE;
if (!IsNvUpdateRequiredForForm (Form)) {
return EFI_SUCCESS;
@@ -3231,6 +3234,7 @@ SubmitForForm ( //
// Submit fail, to get the RestoreConfigRequest and SyncConfigRequest.
//
+ SubmitFormFail = TRUE;
GetSyncRestoreConfigRequest (ConfigInfo->Storage, ConfigInfo->ConfigRequest, Progress, &ConfigInfo->RestoreConfigRequest, &ConfigInfo->SyncConfigRequest);
InsertTailList (&gBrowserSaveFailFormSetList, &ConfigInfo->SaveFailLink);
continue;
@@ -3288,7 +3292,9 @@ SubmitForForm ( //
// 6 Call callback with Submitted type to inform the driver.
//
- SubmitCallback (FormSet, Form);
+ if (!SubmitFormFail) {
+ SubmitCallback (FormSet, Form);
+ }
return Status;
}
@@ -3324,8 +3330,10 @@ SubmitForFormSet ( FORM_BROWSER_FORM *Form;
BOOLEAN HasInserted;
FORM_BROWSER_STATEMENT *Question;
+ BOOLEAN SubmitFormSetFail;
HasInserted = FALSE;
+ SubmitFormSetFail = FALSE;
if (!IsNvUpdateRequiredForFormSet (FormSet)) {
return EFI_SUCCESS;
@@ -3388,6 +3396,7 @@ SubmitForFormSet ( //
// Submit fail, to get the RestoreConfigRequest and SyncConfigRequest.
//
+ SubmitFormSetFail = TRUE;
GetSyncRestoreConfigRequest (FormSetStorage->BrowserStorage, FormSetStorage->ConfigRequest, Progress, &FormSetStorage->RestoreConfigRequest, &FormSetStorage->SyncConfigRequest);
InsertTailList (&FormSet->SaveFailStorageListHead, &FormSetStorage->SaveFailLink);
if (!HasInserted) {
@@ -3481,7 +3490,9 @@ SubmitForFormSet ( //
// 6. Call callback with Submitted type to inform the driver.
//
- SubmitCallback (FormSet, NULL);
+ if (!SubmitFormSetFail) {
+ SubmitCallback (FormSet, NULL);
+ }
return Status;
}
|