Skip to content

Commit 2691afa

Browse files
khaliid2040mergify[bot]
authored andcommitted
UnitTestFrameworkPkg: Increment handle key outside if block
Fixes: #11113 Currently, the global handle key and key inside handle structure is incremented only when a new handle is allocated for protocol interface to be installed. However, when caller already supplies a handle gHandleDatabaseKey never get incremented. Move handle key incremental outside if block, just below the else statement which allows gHandleDatabaseKey to always incremented whether handle is supplied or not. Signed-off-by: Khalid Ali <[email protected]>
1 parent 8f28978 commit 2691afa

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

UnitTestFrameworkPkg/Library/UnitTestUefiBootServicesTableLib/UnitTestUefiBootServicesTableLibProtocol.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -585,12 +585,6 @@ UnitTestInstallProtocolInterfaceNotify (
585585
Handle->Signature = EFI_HANDLE_SIGNATURE;
586586
InitializeListHead (&Handle->Protocols);
587587

588-
//
589-
// Initialize the Key to show that the handle has been created/modified
590-
//
591-
gHandleDatabaseKey++;
592-
Handle->Key = gHandleDatabaseKey;
593-
594588
//
595589
// Add this handle to the list global list of all handles
596590
// in the system
@@ -604,6 +598,12 @@ UnitTestInstallProtocolInterfaceNotify (
604598
}
605599
}
606600

601+
//
602+
// Initialize/update the Key to show that the handle has been created/modified
603+
//
604+
gHandleDatabaseKey++;
605+
Handle->Key = gHandleDatabaseKey;
606+
607607
//
608608
// Each interface that is added must be unique
609609
//

0 commit comments

Comments
 (0)