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.
+Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
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.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
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;