From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=michael.d.kinney@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 6F114210C4DD1 for ; Sun, 29 Jul 2018 22:35:57 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jul 2018 22:35:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,421,1526367600"; d="scan'208";a="61767323" Received: from orsmsx104.amr.corp.intel.com ([10.22.225.131]) by orsmga006.jf.intel.com with ESMTP; 29 Jul 2018 22:35:56 -0700 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.96]) by ORSMSX104.amr.corp.intel.com ([169.254.4.198]) with mapi id 14.03.0319.002; Sun, 29 Jul 2018 22:35:54 -0700 From: "Kinney, Michael D" To: "Zeng, Star" , "edk2-devel@lists.01.org" , "Kinney, Michael D" Thread-Topic: [staging/FmpDevicePkg-master][PATCH] FmpDevicePkg FmpDxe: Initialize DeviceLibLowestSupportedVersion Thread-Index: AdQnsCsnYV/9vOC7Qlig0sI6pj2OHwAFtk2Q Date: Mon, 30 Jul 2018 05:35:53 +0000 Message-ID: References: <0C09AFA07DD0434D9E2A0C6AEB0483103BB8A0E9@shsmsx102.ccr.corp.intel.com> In-Reply-To: <0C09AFA07DD0434D9E2A0C6AEB0483103BB8A0E9@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.22.254.139] MIME-Version: 1.0 Subject: Re: [staging/FmpDevicePkg-master][PATCH] FmpDevicePkg FmpDxe: Initialize DeviceLibLowestSupportedVersion X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jul 2018 05:35:59 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Star, I do not think the logic is identical. The function FmpDeviceGetLowestSupportedVersion() could modify the value of DeviceLibLowestSupportedVersion and=20 return an error. Mike > -----Original Message----- > From: Zeng, Star > Sent: Sunday, July 29, 2018 7:51 PM > To: edk2-devel@lists.01.org > Cc: Kinney, Michael D ; > Zeng, Star > Subject: [staging/FmpDevicePkg-master][PATCH] > FmpDevicePkg FmpDxe: Initialize > DeviceLibLowestSupportedVersion >=20 > Update the title to include "[staging/FmpDevicePkg- > master]". >=20 > Thanks, > Star > -----Original Message----- > From: Zeng, Star > Sent: Monday, July 30, 2018 10:50 AM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Kinney, Michael D > > Subject: [PATCH] FmpDevicePkg FmpDxe: Initialize > DeviceLibLowestSupportedVersion >=20 > Some static tool reports > "DeviceLibLowestSupportedVersion" is used, but is > uninitialized. It is false positive reporting based > because DeviceLibLowestSupportedVersion will have > assigned value after > FmpDeviceGetLowestSupportedVersion() returns SUCCESS. >=20 > This patch refines the code to initialize > DeviceLibLowestSupportedVersion to > DEFAULT_LOWESTSUPPORTEDVERSION before calling > FmpDeviceGetLowestSupportedVersion(). > It can pass the static tool's check. >=20 > Cc: Michael D Kinney > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Star Zeng > --- > FmpDevicePkg/FmpDxe/FmpDxe.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) >=20 > diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c > b/FmpDevicePkg/FmpDxe/FmpDxe.c index > b25a1511c70c..4868f80de2b9 100644 > --- a/FmpDevicePkg/FmpDxe/FmpDxe.c > +++ b/FmpDevicePkg/FmpDxe/FmpDxe.c > @@ -229,10 +229,8 @@ GetLowestSupportedVersion ( > // > // Check the FmpDeviceLib > // > - Status =3D FmpDeviceGetLowestSupportedVersion > (&DeviceLibLowestSupportedVersion); > - if (EFI_ERROR (Status)) { > - DeviceLibLowestSupportedVersion =3D > DEFAULT_LOWESTSUPPORTEDVERSION; > - } > + DeviceLibLowestSupportedVersion =3D > DEFAULT_LOWESTSUPPORTEDVERSION; > + FmpDeviceGetLowestSupportedVersion > (&DeviceLibLowestSupportedVersion); >=20 > if (DeviceLibLowestSupportedVersion > ReturnLsv) { > ReturnLsv =3D DeviceLibLowestSupportedVersion; > -- > 2.7.0.windows.1