diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c index c471a232a0..a15cc828cb 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -2298,31 +2298,20 @@ DiscardForm ( continue; } - // - // Call callback with Changed type to inform the driver. - // - SendDiscardInfoToDriver (FormSet, Form); - // // Prepare // SynchronizeStorageForForm(FormSet, ConfigInfo, FALSE); + + // + // Call callback with Changed type to inform the driver. + // + SendDiscardInfoToDriver (FormSet, Form); } Form->NvUpdateRequired = FALSE; } else if (SettingScope == FormSetLevel && IsNvUpdateRequired(FormSet)) { - Link = GetFirstNode (&FormSet->FormListHead); - while (!IsNull (&FormSet->FormListHead, Link)) { - Form = FORM_BROWSER_FORM_FROM_LINK (Link); - Link = GetNextNode (&FormSet->FormListHead, Link); - - // - // Call callback with Changed type to inform the driver. - // - SendDiscardInfoToDriver (FormSet, Form); - } - // // Discard Buffer storage or Name/Value storage // @@ -2345,6 +2334,17 @@ DiscardForm ( SynchronizeStorage(Storage, FALSE); } + Link = GetFirstNode (&FormSet->FormListHead); + while (!IsNull (&FormSet->FormListHead, Link)) { + Form = FORM_BROWSER_FORM_FROM_LINK (Link); + Link = GetNextNode (&FormSet->FormListHead, Link); + + // + // Call callback with Changed type to inform the driver. + // + SendDiscardInfoToDriver (FormSet, Form); + } + UpdateNvInfoInForm (FormSet, FALSE); } else if (SettingScope == SystemLevel) { //