diff --git a/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c b/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c index 829215ba30..74cc5dfca7 100644 --- a/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c +++ b/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c @@ -143,6 +143,7 @@ CoreConnectController ( // ChildHandleBuffer = AllocatePool (ChildHandleCount * sizeof(EFI_HANDLE)); if (ChildHandleBuffer == NULL) { + CoreReleaseProtocolLock (); return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Core/Dxe/Hand/Notify.c b/MdeModulePkg/Core/Dxe/Hand/Notify.c index 407e3ff8ff..572ba12eed 100644 --- a/MdeModulePkg/Core/Dxe/Hand/Notify.c +++ b/MdeModulePkg/Core/Dxe/Hand/Notify.c @@ -280,10 +280,10 @@ CoreReinstallProtocolInterface ( // CoreNotifyProtocolEntry (ProtEntry); - CoreReleaseProtocolLock (); - Status = EFI_SUCCESS; Done: + CoreReleaseProtocolLock (); + return Status; }