From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web08.5837.1659699836724893471 for ; Fri, 05 Aug 2022 04:43:57 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=mfhNXMsC; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: star.zeng@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659699836; x=1691235836; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=W38+GdUTDI5gCr4gZyep0F0DOSuzwKGC3SYiBgbcglk=; b=mfhNXMsCKq7RdnzFm0OSb92tzZ+dFAWWZSDhNhbtiFkVjcYCFSh2isdW OfytoYqIc45qM6ZX50iJKghDGT4Q5rO5LXMmCvzjG4YGiQk3wI6ymsov3 D5WXZ516DwpheKz9ctygw7KkpgxnR7vXgOAqk58mhbjP4B+X7gaB9KrB8 nslcMnXVU8jbSY2s9mCbNW1EvZ4TKzSyPAI3jqfzY3uXMiXs+RBurKuSV WxkvzW5ImtA4MxIlf66K2mTUmQNZdPvn5vQ86Y6RbwJyJJaYMm+uxLXSj wBLFUfjKLETaYDVcc5hY+kzFclT/oqUTBH1wrzYy8jqpABhEgfY717bzK w==; X-IronPort-AV: E=McAfee;i="6400,9594,10429"; a="316071385" X-IronPort-AV: E=Sophos;i="5.93,216,1654585200"; d="scan'208";a="316071385" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Aug 2022 04:43:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,216,1654585200"; d="scan'208";a="662956195" Received: from shwdeopenlab103.ccr.corp.intel.com ([10.239.182.136]) by fmsmga008.fm.intel.com with ESMTP; 05 Aug 2022 04:43:54 -0700 From: "Zeng, Star" To: devel@edk2.groups.io Cc: Star Zeng , Hao A Wu , Ray Ni , Zhikai Sun Subject: [PATCH] MdeModulePkg XhciPei: Fix dead loop issue in UsbHcFreeMemPool() Date: Fri, 5 Aug 2022 19:43:49 +0800 Message-Id: <20220805114349.1937-1-star.zeng@intel.com> X-Mailer: git-send-email 2.33.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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. 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(-) 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=0D // first block.=0D //=0D - for (Block =3D Pool->Head->Next; Block !=3D NULL; Block =3D Pool->Head->= Next) {=0D + for (Block =3D Pool->Head->Next; Block !=3D NULL; Block =3D Block->Next)= {=0D // UsbHcUnlinkMemBlock (Pool->Head, Block);=0D UsbHcFreeMemBlock (Pool, Block);=0D }=0D --=20 2.33.1.windows.1