]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/PiSmmCore/Locate.c
MdeModulePkg: Return invalid param in LocateProtocol for Protocol==NULL
[mirror_edk2.git] / MdeModulePkg / Core / PiSmmCore / Locate.c
index a7220bae86af223744523db54eaf889a1cc36d11..c174a4dd03b8e513d23987f00aba9b45052f5b5b 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Locate handle functions\r
 \r
-  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials are licensed and made available \r
   under the terms and conditions of the BSD License which accompanies this \r
   distribution.  The full text of the license may be found at        \r
@@ -205,14 +205,10 @@ SmmLocateProtocol (
   PROTOCOL_NOTIFY         *ProtNotify;\r
   IHANDLE                 *Handle;\r
 \r
-  if (Interface == NULL) {\r
+  if ((Interface == NULL) || (Protocol == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  if (Protocol == NULL) {\r
-    return EFI_NOT_FOUND;\r
-  }\r
-\r
   *Interface = NULL;\r
   Status = EFI_SUCCESS;\r
 \r