]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/Hand/Notify.c
Patch from open source community for CryptoPkg to allow it to build for ARM using...
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / Hand / Notify.c
index db3dfa1641aaabc165799b2654027f85da76827d..53780f8e6b1d265d2741142daac7660663c017c1 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
-  UEFI notify infrastructure\r
+  Support functions for UEFI protocol notification infrastructure.\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php\r
@@ -12,7 +12,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#include <DxeMain.h>\r
+#include "DxeMain.h"\r
+#include "Handle.h"\r
 \r
 \r
 /**\r
@@ -132,7 +133,7 @@ CoreRegisterProtocolNotify (
     //\r
     // Allocate a new notification record\r
     //\r
-    ProtNotify = CoreAllocateBootServicesPool (sizeof(PROTOCOL_NOTIFY));\r
+    ProtNotify = AllocatePool (sizeof(PROTOCOL_NOTIFY));\r
     if (ProtNotify != NULL) {\r
 \r
       ProtNotify->Signature = PROTOCOL_NOTIFY_SIGNATURE;\r
@@ -213,8 +214,8 @@ CoreReinstallProtocolInterface (
   //\r
   Prot = CoreFindProtocolInterface (UserHandle, Protocol, OldInterface);\r
   if (Prot == NULL) {\r
-    CoreReleaseProtocolLock ();\r
-    return EFI_NOT_FOUND;\r
+    Status = EFI_NOT_FOUND;\r
+    goto Done;\r
   }\r
 \r
   //\r
@@ -228,8 +229,7 @@ CoreReinstallProtocolInterface (
     //\r
     // One or more drivers refused to release, so return the error\r
     //\r
-    CoreReleaseProtocolLock ();\r
-    return Status;\r
+    goto Done;\r
   }\r
 \r
   //\r
@@ -238,8 +238,8 @@ CoreReinstallProtocolInterface (
   Prot = CoreRemoveInterfaceFromProtocol (Handle, Protocol, OldInterface);\r
 \r
   if (Prot == NULL) {\r
-    CoreReleaseProtocolLock ();\r
-    return EFI_NOT_FOUND;\r
+    Status = EFI_NOT_FOUND;\r
+    goto Done;\r
   }\r
 \r
   ProtEntry = Prot->Protocol;\r
@@ -265,12 +265,15 @@ CoreReinstallProtocolInterface (
   // Release the lock and connect all drivers to UserHandle\r
   //\r
   CoreReleaseProtocolLock ();\r
-  Status = CoreConnectController (\r
-             UserHandle,\r
-             NULL,\r
-             NULL,\r
-             TRUE\r
-             );\r
+  //\r
+  // Return code is ignored on purpose.\r
+  //\r
+  CoreConnectController (\r
+    UserHandle,\r
+    NULL,\r
+    NULL,\r
+    TRUE\r
+    );\r
   CoreAcquireProtocolLock ();\r
 \r
   //\r
@@ -278,7 +281,10 @@ CoreReinstallProtocolInterface (
   //\r
   CoreNotifyProtocolEntry (ProtEntry);\r
 \r
+  Status = EFI_SUCCESS;\r
+\r
+Done:\r
   CoreReleaseProtocolLock ();\r
 \r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r