From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web11.5484.1621386521406015351 for ; Tue, 18 May 2021 18:08:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=RTU9gte7; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: hao.a.wu@intel.com) IronPort-SDR: DZ6Mq80kXFr1yyNZh/92iTmdTCR8J5SpyKQJQQmshI8q4kCMC6Nuxf+VH7bcjYsoyEU5i1k5aX BvbjhQ8FVIqg== X-IronPort-AV: E=McAfee;i="6200,9189,9988"; a="200555139" X-IronPort-AV: E=Sophos;i="5.82,310,1613462400"; d="scan'208";a="200555139" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2021 18:08:40 -0700 IronPort-SDR: 4IJO4ZoqNw3rF249bOaTpm2MQ6+k+si4Ah09BjD6RVcP224Uv8w0KeYln4gwGX8N4OokuTT1Id fJW27amGyCjA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,310,1613462400"; d="scan'208";a="439724953" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga008.jf.intel.com with ESMTP; 18 May 2021 18:08:40 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Tue, 18 May 2021 18:08:39 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4 via Frontend Transport; Tue, 18 May 2021 18:08:39 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.170) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Tue, 18 May 2021 18:08:39 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AiKVlhnyVwXvM63j6uSuZrGucde+Eoz1quxMaQzrBHdvwGAcpyDvjDDDAaDfTCBCDiHe9nxp1STzq6TNNtnkeQ+PoIe9HrVxjntYCQppAU9qBeCn6C+v2oQLQ3oWUTTtvT8no7orr/8zW1SMNw4TlaQrHAXrW60rlxT3LVfSWAAKL+T5vE/P8Q9yyQoFMU5sLZfijrahwjEhNQkSskLQoE232/PiLBrDgsRgL0UTrD1TiPYX+ZP870AXDXCX2WvgBSupFM0gPekdcmwt6PuyUmKXZxy5I3V16ks4Hp3xlEyQZ7mXc6pzNvlD5snOpQ37+LqqbBI8M9Cv5EzFFYpv/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FbaLoW048pHsEWhZnL/s5iedt366zaxh3O2GV02Yp/4=; b=PrX3s/UH/KJhehVo2//0TGxcrcsD8iS3VrWpGNKLdIOsxMUm2Ih+rZ4gyo+SAAOY8e2f7vYPz09DISp/MqckGJXF5qgmxRmo0aEVToacyVDTh3IpHEhzf4EjCdW1y6doPO0hUqKIQqKKMMpRAHojYVGaa/Z4r8PRfItmXU8UicWpB0KXXHGJyA2bepwz5blanM3u6JqhZDy+vzNhyo0ldPOC8z4omdbME7Jto7W5It5QhJcvw+FXCLvx1YijDnYNFz2bAydEFdoNonLfHFl1FpPNGv48wFUsptVeXL+6BxI2yquDsCL+DZGUweT2IDUDNpJj/iVtHP+SdWgJKYZQ7g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FbaLoW048pHsEWhZnL/s5iedt366zaxh3O2GV02Yp/4=; b=RTU9gte7ooqyasLvZ4M/BbLIX2lRTcjL4e+pMAh1Flile4ZS9Ayjf4A/pOKGk6xoFQYGulRkXb0pK0FOqwg+HdHS1a5iod+FCxDSOMQXA5viuDLz3VL6orkQ3s+itM64HxuGzcf3P4JuwSbcS3JsMNC70wvDKBExLSA/0WKD3hA= Received: from BN8PR11MB3666.namprd11.prod.outlook.com (2603:10b6:408:8c::19) by BN6PR1101MB2162.namprd11.prod.outlook.com (2603:10b6:405:50::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.28; Wed, 19 May 2021 01:08:35 +0000 Received: from BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::b9d0:5694:1b70:c031]) by BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::b9d0:5694:1b70:c031%4]) with mapi id 15.20.4129.031; Wed, 19 May 2021 01:08:34 +0000 From: "Wu, Hao A" To: Sergei Dmitrouk , "Ni, Ray" , "devel@edk2.groups.io" CC: "Wang, Jian J" Subject: Re: [PATCH v2 2/3] MdeModulePkg/PciBusDxe: Fix possible uninitialized use Thread-Topic: [PATCH v2 2/3] MdeModulePkg/PciBusDxe: Fix possible uninitialized use Thread-Index: AQHXTACFFmMT2kz1kk+mFDVZrU4QnKrp/tog Date: Wed, 19 May 2021 01:08:34 +0000 Message-ID: References: <20210518160942.17634-1-sergei@posteo.net> <20210518160942.17634-3-sergei@posteo.net> In-Reply-To: <20210518160942.17634-3-sergei@posteo.net> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: posteo.net; dkim=none (message not signed) header.d=none;posteo.net; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.218] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7aee47af-4dff-4f1f-ddba-08d91a62a063 x-ms-traffictypediagnostic: BN6PR1101MB2162: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2399; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2D3d4PzXibkqYIkhCIVUsRTIi1wAElIEqbqh/qWTaJkxDk77tchAZMHsXVlEsD1AtzDuBxNqihhTduxJQcB7X2d77GqhXIZqJBjvtm3i6PFuU42vj3QvdZGc5a0NI5lyEkXv4HMwT327/6yZOfgGhWuObpWpraCTzL30iAHlX8OamESKR0IoJgUOypbsQkzucrZ+rs8TR/1fhu90+iBToIOhX+S6BVQbKFB9iraWyP1xlL4VcB/HDgAohp1wTeD04C9On1j1SNrRjlNs4hbTjjs3I17PcoFxM0YzhTBMhcYG5KKK0IAshmCsL/JDJybD3QMXU7QrFLwKCEubi1/nDglzWbAcBbRWYfehIVihk2b6jIjFoDgqE2G2znaLinXF+kYNnvzQqRXT3FKXrD/5THL3xF9lpSRb9o8OUjmL4YIFqPGGWjFQ2o82HIcez2bVqF16wD9hm3AJYQvvpvk2r/VQw1Lf/4kT5vYN+LX+3/foDm6HyutYlmMQ3p6vFZogGryOExfZ+RaoIpbw2wRHK+rUxt+NNNFTpbaXG5K2prLliBRmYMxYM1NdzHi9actjURP02zvfs/pzDoAuqm2NMVLdX8D9NGjf9tVHiOaIPBM= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR11MB3666.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(39860400002)(376002)(366004)(346002)(396003)(136003)(64756008)(55016002)(66446008)(66946007)(8676002)(66476007)(66556008)(107886003)(4326008)(76116006)(122000001)(478600001)(110136005)(5660300002)(9686003)(71200400001)(316002)(2906002)(8936002)(186003)(7696005)(86362001)(33656002)(6506007)(38100700002)(26005)(52536014)(83380400001)(53546011);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?ycvO+A1UU737JHQTK1B8EuwuhdNEzARBzsX8TBBvkQjQmmy1oVULOaYLq50t?= =?us-ascii?Q?Cz3LAzb08b7REz8wdBbVC6fswEYfW1Xx20ZlzvCy41Lwl/LuUURidLYMqFJB?= =?us-ascii?Q?YEpzacjmxPSlIdRs+pXanOoJGjDwgw1VIq0l1rO5kIHXe+qk2w28aBijsu32?= =?us-ascii?Q?DsLKd6tRHzYEFTt/fwZribL/KOJ3tiDWG6eDOf9LXElDfzKT06d1WsAFUjlc?= =?us-ascii?Q?YOgyKNwVOfVSZWEdV5lfvQaifjAPZX5TEFtpG4cP9bgXX8dZxmzpohSXXRhD?= =?us-ascii?Q?aXMxaOuMNjXQV3sjyNqrU1fFC2fAP5yCI/DK17rMMA8oXSLxfLIxxHCX+oo4?= =?us-ascii?Q?I41xKrkgTyvs31rYbIf96zbNt+Fr7gE0H00AX8H0dQls4TsSJGuMqoZPfVjO?= =?us-ascii?Q?9WnBJ3jxB/TJdRkdfndJYhefj7QAww3oWN4SR//3z4cRTh47jYVMBFUu+ldG?= =?us-ascii?Q?xDEs0uoQsBTfqjYD/HpGxm0FkYnrrW2E5NdTfpWOVgH5FlByXqfV5FY76r++?= =?us-ascii?Q?8NHUsY51hs2/vVVNjhEK6DXXhTtzPVgAdhyGO6TND8Hrc14zRZjEpwC7hD8f?= =?us-ascii?Q?qpxn/T+kGsfY5hKIIdOrd9Fn9P8uU+XFc6Alzs21D43DCSCAbTgbFDtG/BO2?= =?us-ascii?Q?vKboiEKz6Z/oILc/dzVEbhRsN55ZNm4lqtzsqqfBUyjzkqtg+fWK0bpa8V1W?= =?us-ascii?Q?3XAgM1XBHw6gPhd/EAW8Jiw338Pg+ZTJxdgLbbduy4I48JmzcQIUzoRzYD/S?= =?us-ascii?Q?myowHlPT67b5Bbof2FTLunXbQvrPmEKc+3OKC5k06mn343IYOwPeD3P4nlVX?= =?us-ascii?Q?Oqodat51gFA+azYWW+5RRU3fbc6d7xJQWLHL7c9s4bVMp/AZtsmcN1KdrDLd?= =?us-ascii?Q?mARwoyA0tb4Mn87dfP7arBMYvC8hiscUG/+mkKg0ZV7LeOuXKroBt4xz8dk0?= =?us-ascii?Q?iuvyUvUe+yL8FRwk8zpYP1dZDsFoNHu2bql/u+CwGscawzDxiwgzv5fjVEKO?= =?us-ascii?Q?8nbMNNJ0g8J3fmzlvR2xCO8S4wTF/OUtGlfpZ6OQdnaiH2Wpl9MASdyD+uoD?= =?us-ascii?Q?qGe8yBT2C6qmVjEUK+vqLgvkbic/UJmacHfzXjGSU1QD/q4WI80vy3NbOkxn?= =?us-ascii?Q?RfYTqCAKGkAXdRLLJhqpylDYOMaBLSVkG+Ui+vGQeTHPtJoYFxFd8TZSVOvt?= =?us-ascii?Q?c+g5LEGlUVHn4XCIFCpzv8G6wu9mbieHJuXHsQ6quPk8gK0CQJiczs+487KB?= =?us-ascii?Q?UG4+6zAjLkPHbbwbcgAJgdoaxDSMiE7mgLPD0W7awiKMuggyLstH2BqXmxnU?= =?us-ascii?Q?CbKDiNbLXgLQdzYe+0n8B4QV?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN8PR11MB3666.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7aee47af-4dff-4f1f-ddba-08d91a62a063 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 May 2021 01:08:34.8383 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: TPPzgAUdWPlqjd55rjVc+tiXUoHZfbB+jLPVCIviRzZEvXsOMVjbrCKNbD2ZEfGLO4M2pQaDyARNg1/mQBznbg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1101MB2162 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Sergei Dmitrouk > Sent: Wednesday, May 19, 2021 12:10 AM > To: devel@edk2.groups.io > Cc: Wang, Jian J ; Wu, Hao A ; > Ni, Ray > Subject: [PATCH v2 2/3] MdeModulePkg/PciBusDxe: Fix possible uninitialize= d > use >=20 > If the function gets invalid value for the `ResizableBarOp` parameter and > asserts are disabled, `Bit` can be used uninitialized. >=20 > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Ray Ni > Signed-off-by: Sergei Dmitrouk > --- >=20 > Notes: > v2: > - simplify if-statement to avoid unused branches >=20 > MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) >=20 > diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c > b/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c > index 6bba28367165..4caac56f1dcd 100644 > --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c > +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c > @@ -1778,10 +1778,9 @@ PciProgramResizableBar ( >=20 > if (ResizableBarOp =3D=3D PciResizableBarMax) { > Bit =3D HighBitSet64(Capabilities); > - } else if (ResizableBarOp =3D=3D PciResizableBarMin) { > + } else { > + ASSERT (ResizableBarOp =3D=3D PciResizableBarMin); > Bit =3D LowBitSet64(Capabilities); > - } else { > - ASSERT ((ResizableBarOp =3D=3D PciResizableBarMax) || (ResizableBa= rOp =3D=3D > PciResizableBarMin)); Reviewed-by: Hao A Wu Best Regards, Hao Wu > } >=20 > ASSERT (Bit >=3D 0); > -- > 2.17.6