From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.151; helo=mga17.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (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 18E1E210C5142 for ; Sun, 29 Jul 2018 19:51:28 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jul 2018 19:51:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,421,1526367600"; d="scan'208";a="244389257" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga005.jf.intel.com with ESMTP; 29 Jul 2018 19:51:18 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 29 Jul 2018 19:51:18 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 29 Jul 2018 19:51:17 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.124]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.100]) with mapi id 14.03.0319.002; Mon, 30 Jul 2018 10:51:16 +0800 From: "Zeng, Star" To: "edk2-devel@lists.01.org" CC: "Kinney, Michael D" , "Zeng, Star" Thread-Topic: [staging/FmpDevicePkg-master][PATCH] FmpDevicePkg FmpDxe: Initialize DeviceLibLowestSupportedVersion Thread-Index: AdQnsCsnYV/9vOC7Qlig0sI6pj2OHw== Date: Mon, 30 Jul 2018 02:51:15 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BB8A0E9@shsmsx102.ccr.corp.intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: [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 02:51:28 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Update the title to include "[staging/FmpDevicePkg-master]". Thanks, Star -----Original Message----- From: Zeng, Star=20 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 DeviceLibLowestSupportedVe= rsion Some static tool reports "DeviceLibLowestSupportedVersion" is used, but is = uninitialized. It is false positive reporting based because DeviceLibLowest= SupportedVersion will have assigned value after FmpDeviceGetLowestSupportedVersion() returns SUCCESS. This patch refines the code to initialize DeviceLibLowestSupportedVersion t= o DEFAULT_LOWESTSUPPORTEDVERSION before calling FmpDeviceGetLowestSupported= Version(). It can pass the static tool's check. 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(-) diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c b/FmpDevicePkg/FmpDxe/FmpDxe.c in= dex b25a1511c70c..4868f80de2b9 100644 --- a/FmpDevicePkg/FmpDxe/FmpDxe.c +++ b/FmpDevicePkg/FmpDxe/FmpDxe.c @@ -229,10 +229,8 @@ GetLowestSupportedVersion ( // // Check the FmpDeviceLib // - Status =3D FmpDeviceGetLowestSupportedVersion (&DeviceLibLowestSupported= Version); - if (EFI_ERROR (Status)) { - DeviceLibLowestSupportedVersion =3D DEFAULT_LOWESTSUPPORTEDVERSION; - } + DeviceLibLowestSupportedVersion =3D DEFAULT_LOWESTSUPPORTEDVERSION; =20 + FmpDeviceGetLowestSupportedVersion (&DeviceLibLowestSupportedVersion); =20 if (DeviceLibLowestSupportedVersion > ReturnLsv) { ReturnLsv =3D DeviceLibLowestSupportedVersion; -- 2.7.0.windows.1