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.88, mailfrom: shenglei.zhang@intel.com) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by groups.io with SMTP; Mon, 16 Sep 2019 19:48:33 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Sep 2019 19:48:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,515,1559545200"; d="scan'208";a="198546744" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga002.jf.intel.com with ESMTP; 16 Sep 2019 19:48:32 -0700 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 16 Sep 2019 19:48:31 -0700 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 16 Sep 2019 19:48:31 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 16 Sep 2019 19:48:31 -0700 Received: from shsmsx106.ccr.corp.intel.com ([169.254.10.86]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.53]) with mapi id 14.03.0439.000; Tue, 17 Sep 2019 10:48:29 +0800 From: "Zhang, Shenglei" To: "Desimone, Nathaniel L" , "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: AQHVbCtZswSymv6saEa21W+O7Ozkqacuq/mwgAB4qfA= Date: Tue, 17 Sep 2019 02:48:29 +0000 Message-ID: References: <20190916010857.42264-1-shenglei.zhang@intel.com> <02A34F284D1DA44BB705E61F7180EF0AAEED9252@ORSMSX114.amr.corp.intel.com> In-Reply-To: <02A34F284D1DA44BB705E61F7180EF0AAEED9252@ORSMSX114.amr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: shenglei.zhang@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Nathaniel, Thanks for your comments and below is my response. > -----Original Message----- > From: Desimone, Nathaniel L > Sent: Tuesday, September 17, 2019 3:25 AM > 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 >=20 > Hi Shenglei, >=20 > I don't see how this patch is at all related to the previous version of t= his patch. What is different from the previous version is that this patch update the c= opyright year and the "if...else" coding style. > Also, you are introducing yet another new bug with this patch. Moreover, > this bug is unrelated to the previous bug. >=20 > Please take a look at the function TestPointGetAcpi(). With your change > added, this function is now broken since Table is a stack variable and it= is not > being initialized to zero. This function assumes that > DumpAcpiXsdt()/DumpAcpiRsdt() will do the initialization to zero on it's > behalf, you have broken this assumption with your change. I have taken a look at the function TestPointGetAcpi(). The variable Table = is first initialized to NULL by DumpAcpiXsdt()/DumpAcpiRsdt(). The reference code is "*OutTable =3D NULL"(l= ine 667). And it will be assigned a value next. The reference code is "*OutTable =3D Table"(line 689). And with my changes, the stack variable Table(equivalent to *OutTable in D= umpAcpiXsdt/ DumpAcpiRsdt) can still be initialized to NULL or assigned a value. What I did is intended to check th= e address of "Table", since there is no point to perform operations to "Table" if its address is = NULL. Thanks, Shenglei >=20 > Both this patch and the previous patch have been made carelessly and I am > not impressed. >=20 > Thanks, > Nate >=20 > -----Original Message----- > From: Zhang, Shenglei > Sent: Sunday, September 15, 2019 6:09 PM > To: devel@edk2.groups.io > Cc: Kubacki, Michael A ; Chiu, Chasel > ; Desimone, Nathaniel L > ; Gao, Liming > Subject: [PATCH v2] MinPlatformPkg/TestPointCheckLib: Add return value > when OutTable is NULL >=20 > Currently there is no check for the parameter OutTable. > So add the logic that return value EFI_INVALID_PARAMETER when the > OutTable is NULL. >=20 > Cc: Michael Kubacki > Cc: Chasel Chiu > Cc: Nate DeSimone > Cc: Liming Gao > Signed-off-by: Shenglei Zhang > --- >=20 > v2:Update the copyright and the if...else statement coding style. >=20 > .../Test/Library/TestPointCheckLib/DxeCheckAcpi.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) >=20 > diff --git > a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck > Acpi.c > b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck > Acpi.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