]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Revert "MdeModulePkg/DxeCore: Fixed Interface returned by CoreOpenProtocol"
authorStar Zeng <star.zeng@intel.com>
Tue, 27 Jun 2017 01:34:13 +0000 (09:34 +0800)
committerStar Zeng <star.zeng@intel.com>
Tue, 27 Jun 2017 01:34:13 +0000 (09:34 +0800)
This reverts commit 45cfcd8dccf84b8abbc1d6f587fedb5d2037ec79 since it is
breaking OVMF platform and also real platforms.

REF:
https://www.mail-archive.com/edk2-devel@lists.01.org/msg26882.html
https://www.mail-archive.com/edk2-devel@lists.01.org/msg26820.html

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
MdeModulePkg/Core/Dxe/Hand/Handle.c

index fe58b6c583c7cb4eb37f6b2379bc1ae4881ce9bf..59b89148c8f0c51d6adb2ba7c615ffe8f4bf98b5 100644 (file)
@@ -1006,8 +1006,12 @@ CoreOpenProtocol (
   //\r
   // Check for invalid Interface\r
   //\r
-  if ((Attributes != EFI_OPEN_PROTOCOL_TEST_PROTOCOL) && (Interface == NULL)) {\r
-    return EFI_INVALID_PARAMETER;\r
+  if (Attributes != EFI_OPEN_PROTOCOL_TEST_PROTOCOL) {\r
+    if (Interface == NULL) {\r
+      return EFI_INVALID_PARAMETER;\r
+    } else {\r
+      *Interface = NULL;\r
+    }\r
   }\r
 \r
   //\r
@@ -1071,13 +1075,15 @@ CoreOpenProtocol (
   Prot = CoreGetProtocolInterface (UserHandle, Protocol);\r
   if (Prot == NULL) {\r
     Status = EFI_UNSUPPORTED;\r
-    if (Attributes != EFI_OPEN_PROTOCOL_TEST_PROTOCOL){\r
-      //Return NULL Interface if Unsupported Protocol\r
-      *Interface = NULL;\r
-    }\r
     goto Done;\r
   }\r
 \r
+  //\r
+  // This is the protocol interface entry for this protocol\r
+  //\r
+  if (Attributes != EFI_OPEN_PROTOCOL_TEST_PROTOCOL) {\r
+    *Interface = Prot->Interface;\r
+  }\r
   Status = EFI_SUCCESS;\r
 \r
   ByDriver        = FALSE;\r
@@ -1171,14 +1177,6 @@ CoreOpenProtocol (
   }\r
 \r
 Done:\r
-\r
-  //\r
-  // This is the protocol interface entry for this protocol.\r
-  // In case of any Error, Interface should not be updated as per spec.\r
-  //\r
-  if (!EFI_ERROR (Status) && (Attributes != EFI_OPEN_PROTOCOL_TEST_PROTOCOL)) {\r
-    *Interface = Prot->Interface;\r
-  }\r
   //\r
   // Done. Release the database lock are return\r
   //\r