]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Return invalid param in LocateProtocol for Protocol==NULL
authorStar Zeng <star.zeng@intel.com>
Tue, 20 Jun 2017 10:25:29 +0000 (18:25 +0800)
committerStar Zeng <star.zeng@intel.com>
Wed, 21 Jun 2017 13:37:34 +0000 (21:37 +0800)
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>
MdeModulePkg/Core/Dxe/Hand/Locate.c
MdeModulePkg/Core/PiSmmCore/Locate.c

index 80df0d4a6c1d604d73cc3b585fb62d719b227d60..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
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