MdeModulePkg/DxeCapsuleLibFmp: Tolerate EFI_ALREADY_STARTED in LockVariable

When multiple DXE drivers link DxeCapsuleLib, each driver's constructor
calls InitCapsuleVariable() which attempts to lock capsule-related
variables. The second instance fails with EFI_ALREADY_STARTED because
the policy is already registered, triggering a false ASSERT.

EFI_ALREADY_STARTED from RegisterBasicVariablePolicy means the variable
is already locked, which is the desired state. Treat it as success.

Signed-off-by: default avatarAnandh krishna U <anandhkrishnau@ami.com>
This commit is contained in:
Anandh Krishna U 2026-04-28 19:56:07 +05:30 committed by mergify[bot]
parent 5acaac4f32
commit 3b899d2e58

View file

@ -122,7 +122,7 @@ LockVariable (
VARIABLE_POLICY_NO_CANT_ATTR,
VARIABLE_POLICY_TYPE_LOCK_NOW
);
if (EFI_ERROR (Status)) {
if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) {
DEBUG ((
DEBUG_ERROR,
"DxeCapsuleLibFmp: Failed to lock variable %g %s. Status = %r\n",