From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1E2DD21C8F63B for ; Tue, 20 Jun 2017 06:34:40 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jun 2017 06:36:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,364,1493708400"; d="scan'208";a="117115909" Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.9.2]) by fmsmga006.fm.intel.com with ESMTP; 20 Jun 2017 06:36:02 -0700 From: Star Zeng To: edk2-devel@lists.01.org Cc: Star Zeng , Liming Gao Date: Tue, 20 Jun 2017 21:35:57 +0800 Message-Id: <1497965757-138892-3-git-send-email-star.zeng@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 In-Reply-To: <1497965757-138892-1-git-send-email-star.zeng@intel.com> References: <1497965757-138892-1-git-send-email-star.zeng@intel.com> Subject: [PATCH 2/2] MdeModulePkg: Return invalid param in LocateProtocol for Protocol==NULL X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jun 2017 13:34:40 -0000 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 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng --- 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.
+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 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.
+ 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; -- 2.7.0.windows.1