Skip to content

Commit 8f28978

Browse files
khaliid2040mergify[bot]
authored andcommitted
MdeModulePkg/Core: 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 1f5c9f2 commit 8f28978

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

MdeModulePkg/Core/Dxe/Hand/Handle.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -520,12 +520,6 @@ CoreInstallProtocolInterfaceNotify (
520520
Handle->Signature = EFI_HANDLE_SIGNATURE;
521521
InitializeListHead (&Handle->Protocols);
522522

523-
//
524-
// Initialize the Key to show that the handle has been created/modified
525-
//
526-
gHandleDatabaseKey++;
527-
Handle->Key = gHandleDatabaseKey;
528-
529523
//
530524
// Add this handle to the list global list of all handles
531525
// in the system
@@ -539,6 +533,12 @@ CoreInstallProtocolInterfaceNotify (
539533
}
540534
}
541535

536+
//
537+
// Initialize/update the Key to show that the handle has been created/modified
538+
//
539+
gHandleDatabaseKey++;
540+
Handle->Key = gHandleDatabaseKey;
541+
542542
//
543543
// Each interface that is added must be unique
544544
//

0 commit comments

Comments
 (0)