]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/Hand/Handle.c
MdeModulePkg: Enhance the debug message for InstallProtocolInterface
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / Hand / Handle.c
index 1c25521672bacf483ac15fa01e09a76a248e6a77..59b89148c8f0c51d6adb2ba7c615ffe8f4bf98b5 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   UEFI handle & protocol handling.\r
 \r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2017, 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
@@ -428,11 +428,12 @@ CoreInstallProtocolInterfaceNotify (
     // in the system\r
     //\r
     InsertTailList (&gHandleList, &Handle->AllHandles);\r
-  }\r
-\r
-  Status = CoreValidateHandle (Handle);\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
+  } else {\r
+    Status = CoreValidateHandle (Handle);\r
+    if (EFI_ERROR (Status)) {\r
+      DEBUG((DEBUG_ERROR, "InstallProtocolInterface: input handle at 0x%x is invalid\n", Handle));\r
+      goto Done;\r
+    }\r
   }\r
 \r
   //\r
@@ -491,6 +492,7 @@ Done:
     if (Prot != NULL) {\r
       CoreFreePool (Prot);\r
     }\r
+    DEBUG((DEBUG_ERROR, "InstallProtocolInterface: %g %p failed with %r\n", Protocol, Interface, Status));\r
   }\r
 \r
   return Status;\r