]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/Hand/Locate.c
MdeModulePkg: Return invalid param in LocateProtocol for Protocol==NULL
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / Hand / Locate.c
index d2b6da8d6b7d14fa523b9af710cd9341b8498d51..3cc146f3814c6aee7031408c82e0b5d34b48a6ec 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Locate handle functions\r
 \r
-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -560,14 +560,10 @@ CoreLocateProtocol (
   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
@@ -640,7 +636,7 @@ Done:
   @retval EFI_NOT_FOUND          No handles match the search.\r
   @retval EFI_OUT_OF_RESOURCES   There is not enough pool memory to store the\r
                                  matching results.\r
-  @retval EFI_INVALID_PARAMETER  One or more paramters are not valid.\r
+  @retval EFI_INVALID_PARAMETER  One or more parameters are not valid.\r
 \r
 **/\r
 EFI_STATUS\r