public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/2] Return EFI_INVALID_PARAMETER in LocateProtocol for Protocol==NULL
@ 2017-06-20 13:35 Star Zeng
  2017-06-20 13:35 ` [PATCH 1/2] MdePkg: Update comments for LocateProtocol to follow UEFI 2.7 spec Star Zeng
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Star Zeng @ 2017-06-20 13:35 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng

Star Zeng (2):
  MdePkg: Update comments for LocateProtocol to follow UEFI 2.7 spec
  MdeModulePkg: Return invalid param in LocateProtocol for
    Protocol==NULL

 MdeModulePkg/Core/Dxe/Hand/Locate.c  | 8 ++------
 MdeModulePkg/Core/PiSmmCore/Locate.c | 8 ++------
 MdePkg/Include/Uefi/UefiSpec.h       | 1 +
 3 files changed, 5 insertions(+), 12 deletions(-)

-- 
2.7.0.windows.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] MdePkg: Update comments for LocateProtocol to follow UEFI 2.7 spec
  2017-06-20 13:35 [PATCH 0/2] Return EFI_INVALID_PARAMETER in LocateProtocol for Protocol==NULL Star Zeng
@ 2017-06-20 13:35 ` Star Zeng
  2017-06-20 13:35 ` [PATCH 2/2] MdeModulePkg: Return invalid param in LocateProtocol for Protocol==NULL Star Zeng
  2017-06-21 12:11 ` [PATCH 0/2] Return EFI_INVALID_PARAMETER " Gao, Liming
  2 siblings, 0 replies; 4+ messages in thread
From: Star Zeng @ 2017-06-20 13:35 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng, Liming Gao, Michael D Kinney

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
---
 MdePkg/Include/Uefi/UefiSpec.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MdePkg/Include/Uefi/UefiSpec.h b/MdePkg/Include/Uefi/UefiSpec.h
index 9203df934084..eb662a35503c 100644
--- a/MdePkg/Include/Uefi/UefiSpec.h
+++ b/MdePkg/Include/Uefi/UefiSpec.h
@@ -1575,6 +1575,7 @@ EFI_STATUS
   @retval EFI_NOT_FOUND         No protocol instances were found that match Protocol and
                                 Registration.
   @retval EFI_INVALID_PARAMETER Interface is NULL.
+                                Protocol is NULL.
 
 **/
 typedef
-- 
2.7.0.windows.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] MdeModulePkg: Return invalid param in LocateProtocol for Protocol==NULL
  2017-06-20 13:35 [PATCH 0/2] Return EFI_INVALID_PARAMETER in LocateProtocol for Protocol==NULL Star Zeng
  2017-06-20 13:35 ` [PATCH 1/2] MdePkg: Update comments for LocateProtocol to follow UEFI 2.7 spec Star Zeng
@ 2017-06-20 13:35 ` Star Zeng
  2017-06-21 12:11 ` [PATCH 0/2] Return EFI_INVALID_PARAMETER " Gao, Liming
  2 siblings, 0 replies; 4+ messages in thread
From: Star Zeng @ 2017-06-20 13:35 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng, Liming Gao

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>
---
 MdeModulePkg/Core/Dxe/Hand/Locate.c  | 8 ++------
 MdeModulePkg/Core/PiSmmCore/Locate.c | 8 ++------
 2 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/MdeModulePkg/Core/Dxe/Hand/Locate.c b/MdeModulePkg/Core/Dxe/Hand/Locate.c
index 80df0d4a6c1d..3cc146f3814c 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 a7220bae86af..c174a4dd03b8 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;
 
-- 
2.7.0.windows.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] Return EFI_INVALID_PARAMETER in LocateProtocol for Protocol==NULL
  2017-06-20 13:35 [PATCH 0/2] Return EFI_INVALID_PARAMETER in LocateProtocol for Protocol==NULL Star Zeng
  2017-06-20 13:35 ` [PATCH 1/2] MdePkg: Update comments for LocateProtocol to follow UEFI 2.7 spec Star Zeng
  2017-06-20 13:35 ` [PATCH 2/2] MdeModulePkg: Return invalid param in LocateProtocol for Protocol==NULL Star Zeng
@ 2017-06-21 12:11 ` Gao, Liming
  2 siblings, 0 replies; 4+ messages in thread
From: Gao, Liming @ 2017-06-21 12:11 UTC (permalink / raw)
  To: Zeng, Star, edk2-devel@lists.01.org; +Cc: Zeng, Star

Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Star Zeng
> Sent: Tuesday, June 20, 2017 9:36 PM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star <star.zeng@intel.com>
> Subject: [edk2] [PATCH 0/2] Return EFI_INVALID_PARAMETER in LocateProtocol for Protocol==NULL
> 
> Star Zeng (2):
>   MdePkg: Update comments for LocateProtocol to follow UEFI 2.7 spec
>   MdeModulePkg: Return invalid param in LocateProtocol for
>     Protocol==NULL
> 
>  MdeModulePkg/Core/Dxe/Hand/Locate.c  | 8 ++------
>  MdeModulePkg/Core/PiSmmCore/Locate.c | 8 ++------
>  MdePkg/Include/Uefi/UefiSpec.h       | 1 +
>  3 files changed, 5 insertions(+), 12 deletions(-)
> 
> --
> 2.7.0.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-21 12:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-20 13:35 [PATCH 0/2] Return EFI_INVALID_PARAMETER in LocateProtocol for Protocol==NULL Star Zeng
2017-06-20 13:35 ` [PATCH 1/2] MdePkg: Update comments for LocateProtocol to follow UEFI 2.7 spec Star Zeng
2017-06-20 13:35 ` [PATCH 2/2] MdeModulePkg: Return invalid param in LocateProtocol for Protocol==NULL Star Zeng
2017-06-21 12:11 ` [PATCH 0/2] Return EFI_INVALID_PARAMETER " Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox