[PATCH] MdeModulePkg XhciPei: Fix dead loop issue in UsbHcFreeMemPool()


Zeng, Star
 

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 <hao.a.wu@...>
Cc: Ray Ni <ray.ni@...>
Cc: Zhikai Sun <zhikai.sun@...>
Signed-off-by: Star Zeng <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

Join devel@edk2.groups.io to automatically receive all group messages.