summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Core
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2017-06-20 18:25:29 +0800
committerStar Zeng <star.zeng@intel.com>2017-06-21 21:37:34 +0800
commit415fc5e5a4c98f84fd49277872fc49d37aa7e5a1 (patch)
tree2865c4a0bda4f04ca0d1f441c049416b520f111b /MdeModulePkg/Core
parentd65f7eeb4ca24f9ce9191f6fc6bd6c5d101c5731 (diff)
downloadedk2-415fc5e5a4c98f84fd49277872fc49d37aa7e5a1.tar.gz
edk2-415fc5e5a4c98f84fd49277872fc49d37aa7e5a1.tar.bz2
edk2-415fc5e5a4c98f84fd49277872fc49d37aa7e5a1.zip
MdeModulePkg: Return invalid param in LocateProtocol for Protocol==NULL
Return EFI_INVALID_PARAMETER in LocateProtocol for Protocol==NULL to follow UEFI 2.7 spec PiSmmCore is also updated as the EFI_SMM_SYSTEM_TABLE2.SmmLocateProtocol is reusing the definition of EFI_LOCATE_PROTOCOL. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'MdeModulePkg/Core')
-rw-r--r--MdeModulePkg/Core/Dxe/Hand/Locate.c8
-rw-r--r--MdeModulePkg/Core/PiSmmCore/Locate.c8
2 files changed, 4 insertions, 12 deletions
diff --git a/MdeModulePkg/Core/Dxe/Hand/Locate.c b/MdeModulePkg/Core/Dxe/Hand/Locate.c
index 80df0d4a6c..3cc146f381 100644
--- a/MdeModulePkg/Core/Dxe/Hand/Locate.c
+++ b/MdeModulePkg/Core/Dxe/Hand/Locate.c
@@ -1,7 +1,7 @@
/** @file
Locate handle functions
-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -560,14 +560,10 @@ CoreLocateProtocol (
PROTOCOL_NOTIFY *ProtNotify;
IHANDLE *Handle;
- if (Interface == NULL) {
+ if ((Interface == NULL) || (Protocol == NULL)) {
return EFI_INVALID_PARAMETER;
}
- if (Protocol == NULL) {
- return EFI_NOT_FOUND;
- }
-
*Interface = NULL;
Status = EFI_SUCCESS;
diff --git a/MdeModulePkg/Core/PiSmmCore/Locate.c b/MdeModulePkg/Core/PiSmmCore/Locate.c
index a7220bae86..c174a4dd03 100644
--- a/MdeModulePkg/Core/PiSmmCore/Locate.c
+++ b/MdeModulePkg/Core/PiSmmCore/Locate.c
@@ -1,7 +1,7 @@
/** @file
Locate handle functions
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License which accompanies this
distribution. The full text of the license may be found at
@@ -205,14 +205,10 @@ SmmLocateProtocol (
PROTOCOL_NOTIFY *ProtNotify;
IHANDLE *Handle;
- if (Interface == NULL) {
+ if ((Interface == NULL) || (Protocol == NULL)) {
return EFI_INVALID_PARAMETER;
}
- if (Protocol == NULL) {
- return EFI_NOT_FOUND;
- }
-
*Interface = NULL;
Status = EFI_SUCCESS;