]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/Hand/Locate.c
MdeModulePkg/DxeCore: Avoid assertion in CoreLocateProtocol
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / Hand / Locate.c
index d98b55ab9363b7951dd73fd1dad9d7592867d5df..d2b6da8d6b7d14fa523b9af710cd9341b8498d51 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Locate handle functions\r
 \r
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2016, 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
@@ -581,7 +581,10 @@ CoreLocateProtocol (
   //\r
   // Lock the protocol database\r
   //\r
-  CoreAcquireProtocolLock ();\r
+  Status = CoreAcquireLockOrFail (&gProtocolDatabaseLock);\r
+  if (EFI_ERROR (Status)) {\r
+    return EFI_NOT_FOUND;\r
+  }\r
 \r
   mEfiLocateHandleRequest += 1;\r
 \r