[CHERRY-PICK] MdeModulePkg: Improved error handling in RuntimeDxe Variable drivers [Rebase & FF] - #1898
Draft
PaddyDeng-v wants to merge 1 commit into
Conversation
Replace ASSERT_EFI_ERROR with proper error handling that returns failure status codes. This ensures platforms with ASSERT_DEADLOOP_ENABLED disabled handle errors gracefully. (cherry picked from commit 8bf75267f9311a8a66a3864ee71426c70bb288bb) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
PaddyDeng-v
marked this pull request as draft
August 31, 2026 10:44
Collaborator
|
Please amend the commit to contain [Cherry-Pick] in the commit message title. |
Member
Also, same additional request mentioned in #1899 (review). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Cherry-pick of tianocore/edk2 PR #12670 (commit 8bf75267f9311a8a66a3864ee71426c70bb288bb).
This PR improves error handling in the Variable SMM/DXE RuntimeDxe drivers by replacing
ASSERT_EFI_ERRORcalls with proper error-returning handling. This ensures platforms withASSERT_DEADLOOP_ENABLEDdisabled handle initialization errors gracefully instead ofsilently continuing.
Changes
ASSERT_EFI_ERRORwithif (EFI_ERROR(...))+DEBUG+goto ErrorExitpatternErrorExitcleanup paths inVariableServiceInitialize()andMmVariableServiceInitialize()VariableCommonInitialize()error paths (callers handle cleanup)gEfiVariableArchProtocolGuidinstallation to end ofVariableServiceInitialize()VariableClearNotifySmmReady()function for SMM notification cleanupConflict Resolution
VariableDxe.c: Preserved mu_basecore'sInitializeVariablePolicyLockingcall (MU_CHANGE)while wrapping it with proper error handling instead of
ASSERT_EFI_ERROR.How This Was Tested
Cherry-picked and conflict-resolved from upstream edk2 where it passed CI.
Integration Checklist