summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Core/Dxe
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2017-06-27 09:34:13 +0800
committerStar Zeng <star.zeng@intel.com>2017-06-27 09:34:13 +0800
commitfd220166c435479a81dfe8519c92abec9acf7d82 (patch)
tree21e1413f2b835e96c5429cbe3351135461509a07 /MdeModulePkg/Core/Dxe
parent061ead7a2dcc92c93e97c89fc9892032e7707bda (diff)
downloadedk2-fd220166c435479a81dfe8519c92abec9acf7d82.tar.gz
edk2-fd220166c435479a81dfe8519c92abec9acf7d82.tar.bz2
edk2-fd220166c435479a81dfe8519c92abec9acf7d82.zip
Revert "MdeModulePkg/DxeCore: Fixed Interface returned by CoreOpenProtocol"
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>
Diffstat (limited to 'MdeModulePkg/Core/Dxe')
-rw-r--r--MdeModulePkg/Core/Dxe/Hand/Handle.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/MdeModulePkg/Core/Dxe/Hand/Handle.c b/MdeModulePkg/Core/Dxe/Hand/Handle.c
index fe58b6c583..59b89148c8 100644
--- a/MdeModulePkg/Core/Dxe/Hand/Handle.c
+++ b/MdeModulePkg/Core/Dxe/Hand/Handle.c
@@ -1006,8 +1006,12 @@ CoreOpenProtocol (
//
// Check for invalid Interface
//
- if ((Attributes != EFI_OPEN_PROTOCOL_TEST_PROTOCOL) && (Interface == NULL)) {
- return EFI_INVALID_PARAMETER;
+ if (Attributes != EFI_OPEN_PROTOCOL_TEST_PROTOCOL) {
+ if (Interface == NULL) {
+ return EFI_INVALID_PARAMETER;
+ } else {
+ *Interface = NULL;
+ }
}
//
@@ -1071,13 +1075,15 @@ CoreOpenProtocol (
Prot = CoreGetProtocolInterface (UserHandle, Protocol);
if (Prot == NULL) {
Status = EFI_UNSUPPORTED;
- if (Attributes != EFI_OPEN_PROTOCOL_TEST_PROTOCOL){
- //Return NULL Interface if Unsupported Protocol
- *Interface = NULL;
- }
goto Done;
}
+ //
+ // This is the protocol interface entry for this protocol
+ //
+ if (Attributes != EFI_OPEN_PROTOCOL_TEST_PROTOCOL) {
+ *Interface = Prot->Interface;
+ }
Status = EFI_SUCCESS;
ByDriver = FALSE;
@@ -1171,14 +1177,6 @@ CoreOpenProtocol (
}
Done:
-
- //
- // This is the protocol interface entry for this protocol.
- // In case of any Error, Interface should not be updated as per spec.
- //
- if (!EFI_ERROR (Status) && (Attributes != EFI_OPEN_PROTOCOL_TEST_PROTOCOL)) {
- *Interface = Prot->Interface;
- }
//
// Done. Release the database lock are return
//