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>
//\r
// Check for invalid Interface\r
//\r
//\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
Prot = CoreGetProtocolInterface (UserHandle, Protocol);\r
if (Prot == NULL) {\r
Status = EFI_UNSUPPORTED;\r
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
+ //\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
Status = EFI_SUCCESS;\r
\r
ByDriver = FALSE;\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
//\r
// Done. Release the database lock are return\r
//\r