From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web08.20042.1659920926847900357 for ; Sun, 07 Aug 2022 18:08:47 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=joFHLVTG; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: hao.a.wu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659920926; x=1691456926; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=VMsJMk+g5sXi89uqQ0R0mZh8MiE5aGpfmpQYNrcJQN0=; b=joFHLVTG2vwTRqlHRL3vOqhqAHT7nH47Tlh/1HJp0/1isETd56F6jkGn 9bAux12ozQhFj7P/0utfyghNWqLBbA0rYBVL450aOQRbS5rBebDxlPQ+v F479lWMUAh5DEwzB8zwQ83JOtjALzB8RWR1uo/EMupUwKH1LyodvTWad+ 2GlqGiPy7WX8VaTjxzzMA6NEG7bKQsbWldWnvJH8UJjlz9Wd/o5nw2jd0 ogArC4ygmu8IXqgrsNKM2ANBx6qTOfIS4pTJgGAJKY6n2TT3MBxcI11R4 Cc3NSp0UUWbDDUI7L2GcnxLhoZqFT18AYo+uBu2XRFIjM//u+UUo5IrGm g==; X-IronPort-AV: E=McAfee;i="6400,9594,10432"; a="273525227" X-IronPort-AV: E=Sophos;i="5.93,221,1654585200"; d="scan'208";a="273525227" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2022 18:08:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,221,1654585200"; d="scan'208";a="730545291" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga004.jf.intel.com with ESMTP; 07 Aug 2022 18:08:46 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sun, 7 Aug 2022 18:08:45 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) 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.2375.28 via Frontend Transport; Sun, 7 Aug 2022 18:08:45 -0700 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.42) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.28; Sun, 7 Aug 2022 18:08:45 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qr+7+Mtspwb8QRblXbg5xeNYbgl2wCfDGbUZ8cBg8+fiewvY7QPKzHshXH0eW6/1dAPauHdIvv2apkBaGw1pCja9YTwnw9PmiPhaaauq/W8Ae2lwcgEd3WadkBw9sEfJ/FCIk6OygUySweOdP6gowpLMqLkJZ33hwRz+qa6qexMp0n7I+RFzEv+8G9sctPBvnvGpXEuwb/tOUWJHrQsVjfq1VLMjb8sj6LdYExy14i4XUVgIWizBCaIwdK9ZqdRaI3Rz5gnoqSS4qyMnt87L11ByykSWIRnETayaN420GmAt/7hTYvETjE/dgJniMkNMxp7Ndkufr4FZRtLUzvyYCA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZkyDfMWAHHjq73JFnOYaZoHQ6VvM9gGocAss7v73+nY=; b=Nz7JzhD/sbMmgcfOzm1bx/vo8IprhPANyzrntmfAZRKAEJuysMAvQ/wggXJjsYR9zdq7ZU28ncm7eoDsYyCAno6+HPPU4+0kfLZYw42USS4hRRDXEOVbGGoM/n1NprN3i2mnkY8Tybnz/6d6c/rytslfw2Y1A0AqDQx08CDnf0+oYH/GqDC1n+DezOhjLNUBf+X6gY5rYZf+AkYQD+iC0BA5hldkub4oZibSdmkV7Qf/Tj2NDLWw6vAx6NpB9ZW2YoruyDW1ioqPe/ulD1u0b9hRkSmOy7sx7xLae7DxrxAEetA0OKcMNFf0OCgGZnh77YAQCOPcOUoq771ibqk3yg== 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 Received: from DM6PR11MB4025.namprd11.prod.outlook.com (2603:10b6:5:197::31) by BN0PR11MB5693.namprd11.prod.outlook.com (2603:10b6:408:164::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.16; Mon, 8 Aug 2022 01:08:44 +0000 Received: from DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::1daf:5a6d:a3d:b10]) by DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::1daf:5a6d:a3d:b10%3]) with mapi id 15.20.5504.019; Mon, 8 Aug 2022 01:08:44 +0000 From: "Wu, Hao A" To: "Zeng, Star" , "devel@edk2.groups.io" CC: "Ni, Ray" , "Sun, Zhikai" Subject: Re: [PATCH] MdeModulePkg XhciPei: Fix dead loop issue in UsbHcFreeMemPool() Thread-Topic: [PATCH] MdeModulePkg XhciPei: Fix dead loop issue in UsbHcFreeMemPool() Thread-Index: AQHYqMCpWcQk/Yc2okeFqxMhU5tcAa2kNKBQ Date: Mon, 8 Aug 2022 01:08:43 +0000 Message-ID: References: <20220805114349.1937-1-star.zeng@intel.com> In-Reply-To: <20220805114349.1937-1-star.zeng@intel.com> 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: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 18e66e15-7d7d-4fce-aa7c-08da78da8a04 x-ms-traffictypediagnostic: BN0PR11MB5693:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: OnbErdiqVV3UYykPw/lmbVIWVkcZZl8KRkx+zKa+pynOHAAFr9yFGzPAtTofl2rSSGe+6FqJYkke7jCvs/G9GZImUgP+kZmgM/0bZQMmDfXUiDjcCBhEpwZWB+2R9EZ9DZTd/P2ePklEnjx0esXPeZ7TwWC+Kik0SZNUAeT/JVaq4/ygtRSxNrzVxxe2vccsjeGUduvbL69rRR3/dBuspmixDl7rr/k9TKfxnkTHRwTgEjIH+yq7sM9lC6oesv9fjNjj4Xl0Hp0zilxSFMh3OVVoYqEYGUbVSXVptZOed23IFlfeXfl5EfaSGdzqE46505FZNkBP0ysSdNShaCIue8kZtJt59yDjjxGbBWpvJrtWSNSKigMuz6WFU0hPR37l7u1tfZ8bh4a/I55drI5WRHe2qjyQgbJg0yh2gtK24m2bPKSPygQThrGlRF1SKpaWXn0cp+5LJnaWgMffgHBGTQEJuRBflxNKHb1iQ7bwqfuzI9WXLzlLjncXUZkdr/ZljrA/ZIn8CFmgbzYgWyP3LdoYNn2/UFrixKVow5MPJ4QHfi3ssByqI1aHWUrLGAmBQhO4AXEn86Oh9JsuesTnC/pF7DYqDP3Awgn+EbBe8YoUK3QdCT1cPRVtlyx5CFIHMwUOujy1x0fxdfMf2B85C51ZNcjMRp5RTXHD+Z5mTeWfWgkh2enhYogMEzSrSfzdaPGI2e0CC2I5nVkVRznfOBTIV2gM8zVPlwQY/CazGxdNgWjSfjI5BgPnePYgaGnd8pLxW0vwOfq//LtxutktLZxzTVhjHVXRIds28Kc5J8ad2sAmQdC52eM3L6I+RHLd x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4025.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(6029001)(366004)(376002)(396003)(136003)(346002)(39860400002)(86362001)(9686003)(41300700001)(6506007)(7696005)(53546011)(26005)(38070700005)(122000001)(38100700002)(107886003)(83380400001)(186003)(82960400001)(5660300002)(8936002)(55016003)(2906002)(52536014)(76116006)(66946007)(4326008)(66446008)(64756008)(8676002)(66476007)(33656002)(66556008)(110136005)(478600001)(54906003)(316002)(71200400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?0d5nrQY+BXP3X6LxhzQ00Acw4an0ZTd4b8rEIo3saufRKfml1nVAlsHaewzz?= =?us-ascii?Q?UX95a5gF9t64BZJWaf1Jtu0XcFcbWCCLz3UufupsG3MqYDjoh7qcceSBo1bO?= =?us-ascii?Q?1KWcqquXJphkUn9XMSJCDQo3mFL0mG2xe1/KR0r241LG+/GYbmHQh+CMzhoT?= =?us-ascii?Q?kS4KWOmV1VE+1wFWaHj6vRjFWF3GCsPdO/6+tXX7sNhmg+vFsEhAHV/aXAcR?= =?us-ascii?Q?NPqQnves5HBgHZOOHnm9EYd501uK33GUPy7jSra9bcU7xSG31Q69vlNV1woP?= =?us-ascii?Q?3MJXvtadgLqPUIjobflRzx70QpLE0dnt9ub9gqvLtpWCSPHO7rFOxf3mSlAl?= =?us-ascii?Q?GiW4HvUGV4fxr+Xee9nC4GoSR8vR+sIuGGJVP8ohfzHndORcAWRhPoKbRD4X?= =?us-ascii?Q?aJSw/0zmGoVmStEhi2H+UpFwhlIEMKTxMG61mOrefiNNYtBhSkrjKYXm/BCq?= =?us-ascii?Q?m4lyTZLr+Yn0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-ascii?Q?6502IPa86hcwLbeBWb7Npj3c9gRxFwFEZZR6JS190TndqbiSjXH9L362Dqn2?= =?us-ascii?Q?lAvJEicXzRPORhRB+f3fITpofAlLWI5JkCC+K3g9yxJSwTrfllA6YPxvZViC?= =?us-ascii?Q?h+SSJXxKQ51ecvO8bq8F0LtDfEwh2osxrUwiZa1hnd4m0VWS/qrquD8Tdvtx?= =?us-ascii?Q?hHyT6Y6yciYmrESptqeQU5eqgjIx3O0LOuzYsApm?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4025.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 18e66e15-7d7d-4fce-aa7c-08da78da8a04 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Aug 2022 01:08:43.9486 (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: Zkg/t1lvNgwGlphX9CIN1YqAVEKEfUtU6uyec6P+bVQRhGJYRg8Q3OpAi4V5wizViN8vgatDF5Xi6MzDjbx1Kw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR11MB5693 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 Thanks Star, How about removing the comments that mention 'UsbHcUnlinkMemBlock' (3 occur= rences, in UsbHcFreeMemPool() and UsbHcFreeMem()) to avoid possible confusi= on? Best Regards, Hao Wu > -----Original Message----- > From: Zeng, Star > Sent: Friday, August 5, 2022 7:44 PM > To: devel@edk2.groups.io > Cc: Zeng, Star ; Wu, Hao A ; Ni, > Ray ; Sun, Zhikai > Subject: [PATCH] MdeModulePkg XhciPei: Fix dead loop issue in > UsbHcFreeMemPool() >=20 > Use Block->Next instead of Pool->Head->Next, otherwise the for loop will = be > not able to come out. > It will also match with the UsbHcFreeMemPool() in EhciPei. >=20 > Cc: Hao A Wu > Cc: Ray Ni > Cc: Zhikai Sun > Signed-off-by: Star Zeng > --- > MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c > b/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c > index c64b38fcfc89..148425ae844e 100644 > --- a/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c > +++ b/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c > @@ -385,7 +385,7 @@ UsbHcFreeMemPool ( > // UsbHcUnlinkMemBlock can't be used to unlink and free the // first= block. > //- for (Block =3D Pool->Head->Next; Block !=3D NULL; Block =3D Pool->He= ad->Next) > {+ for (Block =3D Pool->Head->Next; Block !=3D NULL; Block =3D Block->Ne= xt) { // > UsbHcUnlinkMemBlock (Pool->Head, Block); UsbHcFreeMemBlock (Pool, > Block); }-- > 2.33.1.windows.1