From 275ea01efdf0aa7be0b5352ff185cc77aef129c0 Mon Sep 17 00:00:00 2001 From: Eric Dong Date: Wed, 27 Aug 2014 03:29:01 +0000 Subject: [PATCH] Refine the fix for the bug that cause assert when do the reconnect in the callback function. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong Reviewed-by: Liming Gao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15914 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Universal/SetupBrowserDxe/Presentation.c | 28 ------------------- .../Universal/SetupBrowserDxe/Setup.c | 5 +++- 2 files changed, 4 insertions(+), 29 deletions(-) diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c index 42af5f7103..f0617f81b3 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c @@ -1985,17 +1985,6 @@ ProcessCallBackFunction ( TypeValue, &ActionRequest ); - // - // IFR is updated, force to reparse the IFR binary - // - if (mHiiPackageListUpdated) { - if (BackUpBuffer != NULL) { - FreePool (BackUpBuffer); - } - - return EFI_SUCCESS; - } - if (!EFI_ERROR (Status)) { // // Need to sync the value between Statement->HiiValue->Value and Statement->BufferValue @@ -2412,15 +2401,6 @@ SetupBrowser ( ((Statement->QuestionFlags & EFI_IFR_FLAG_CALLBACK) == EFI_IFR_FLAG_CALLBACK) && (Statement->Operand != EFI_IFR_PASSWORD_OP)) { Status = ProcessCallBackFunction(Selection, Selection->FormSet, Selection->Form, Statement, EFI_BROWSER_ACTION_CHANGING, FALSE); - // - // IFR is updated during callback of EFI_BROWSER_ACTION_CHANGING, force to reparse the IFR binary - // - if (mHiiPackageListUpdated) { - Selection->Action = UI_ACTION_REFRESH_FORMSET; - mHiiPackageListUpdated = FALSE; - break; - } - if (Statement->Operand == EFI_IFR_REF_OP) { // // Process dynamic update ref opcode. @@ -2448,14 +2428,6 @@ SetupBrowser ( if (!EFI_ERROR (Status) && Statement->Operand != EFI_IFR_REF_OP) { ProcessCallBackFunction(Selection, Selection->FormSet, Selection->Form, Statement, EFI_BROWSER_ACTION_CHANGED, FALSE); - // - // IFR is updated during callback of EFI_BROWSER_ACTION_CHANGED, force to reparse the IFR binary - // - if (mHiiPackageListUpdated) { - Selection->Action = UI_ACTION_REFRESH_FORMSET; - mHiiPackageListUpdated = FALSE; - break; - } } } else { // diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c index a8bbd582b5..2b09593b91 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -2449,7 +2449,10 @@ ValidateFormSet ( ASSERT (FormSet != NULL); Find = ValidateHiiHandle(FormSet->HiiHandle); - if (!Find) { + // + // Should not remove the formset which is being used. + // + if (!Find && (FormSet != gCurrentSelection->FormSet)) { CleanBrowserStorage(FormSet); RemoveEntryList (&FormSet->Link); DestroyFormSet (FormSet); -- 2.39.5