From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: nathaniel.l.desimone@intel.com) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by groups.io with SMTP; Mon, 16 Sep 2019 12:25:03 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Sep 2019 12:25:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,513,1559545200"; d="scan'208";a="337757875" Received: from orsmsx102.amr.corp.intel.com ([10.22.225.129]) by orsmga004.jf.intel.com with ESMTP; 16 Sep 2019 12:25:02 -0700 Received: from orsmsx161.amr.corp.intel.com (10.22.240.84) by ORSMSX102.amr.corp.intel.com (10.22.225.129) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 16 Sep 2019 12:25:02 -0700 Received: from orsmsx114.amr.corp.intel.com ([169.254.8.225]) by ORSMSX161.amr.corp.intel.com ([169.254.4.111]) with mapi id 14.03.0439.000; Mon, 16 Sep 2019 12:25:02 -0700 From: "Nate DeSimone" To: "Zhang, Shenglei" , "devel@edk2.groups.io" CC: "Kubacki, Michael A" , "Chiu, Chasel" , "Gao, Liming" Subject: Re: [PATCH v2] MinPlatformPkg/TestPointCheckLib: Add return value when OutTable is NULL Thread-Topic: [PATCH v2] MinPlatformPkg/TestPointCheckLib: Add return value when OutTable is NULL Thread-Index: AQHVbCtZhN3Yp8lbakmLW+XYWv13Nacuq/mw Date: Mon, 16 Sep 2019 19:25:00 +0000 Message-ID: <02A34F284D1DA44BB705E61F7180EF0AAEED9252@ORSMSX114.amr.corp.intel.com> References: <20190916010857.42264-1-shenglei.zhang@intel.com> In-Reply-To: <20190916010857.42264-1-shenglei.zhang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMjM4MDgwZTMtYjZiNy00YmEzLWJkNWEtZmNmMTY5ZjI5MDQyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiOExlK09LdE5wOUhJRHBSTDJZZlAyd09hODhyQU9lVDBSSktIUXlsOFhDXC9EWUNIWXY2a0FBSWg1S01tam5ESVkifQ== x-ctpclassification: CTP_NT x-originating-ip: [10.22.254.140] MIME-Version: 1.0 Return-Path: nathaniel.l.desimone@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Shenglei, I don't see how this patch is at all related to the previous version of thi= s patch. Also, you are introducing yet another new bug with this patch. Mor= eover, this bug is unrelated to the previous bug. Please take a look at the function TestPointGetAcpi(). With your change add= ed, this function is now broken since Table is a stack variable and it is n= ot being initialized to zero. This function assumes that DumpAcpiXsdt()/Dum= pAcpiRsdt() will do the initialization to zero on it's behalf, you have bro= ken this assumption with your change. Both this patch and the previous patch have been made carelessly and I am n= ot impressed. Thanks, Nate -----Original Message----- From: Zhang, Shenglei =20 Sent: Sunday, September 15, 2019 6:09 PM To: devel@edk2.groups.io Cc: Kubacki, Michael A ; Chiu, Chasel ; Desimone, Nathaniel L ; Ga= o, Liming Subject: [PATCH v2] MinPlatformPkg/TestPointCheckLib: Add return value when= OutTable is NULL Currently there is no check for the parameter OutTable. So add the logic that return value EFI_INVALID_PARAMETER when the OutTable = is NULL. Cc: Michael Kubacki Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Signed-off-by: Shenglei Zhang --- v2:Update the copyright and the if...else statement coding style. .../Test/Library/TestPointCheckLib/DxeCheckAcpi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/D= xeCheckAcpi.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLi= b/DxeCheckAcpi.c index 263781a2..83736bf3 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck= Acpi.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCh +++ eckAcpi.c @@ -1,6 +1,6 @@ /** @file =20 -Copyright (c) 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -610,6 +610,8 @@ DumpAcpiRsdt ( =20 if (OutTable !=3D NULL) { *OutTable =3D NULL; + } else{ + return EFI_INVALID_PARAMETER; } =20 ReturnStatus =3D EFI_SUCCESS; @@ -663,6 +665,8 @@ DumpAcpiXsdt ( =20 if (OutTable !=3D NULL) { *OutTable =3D NULL; + } else{ + return EFI_INVALID_PARAMETER; } =20 ReturnStatus =3D EFI_SUCCESS; -- 2.18.0.windows.1