]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix bug in PciHostBridgeEnumerator().
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 7 May 2010 22:44:54 +0000 (22:44 +0000)
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 7 May 2010 22:44:54 +0000 (22:44 +0000)
A linked list is created for the list of PCI Root Bridges in the platform.  This list is then traversed to enumerate each PCI Root Bridge.  After enumeration, the RootBridgeDev is destroyed, but it was not removed from the linked list before it was destroyed.  This left the linked list of PCI Root Bridges in a bad state, specially if memory is cleared on frees, or the freed buffer was reallocated.

The fix is to remove the node from the linked list before the RootBridgeDev is destroyed.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10463 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c

index 548b8a2298205e328619ad968b61fb6609240887..8397a405823b934d64fa83cfe01313614e7cc57f 100644 (file)
@@ -1241,7 +1241,7 @@ PciHostBridgeEnumerator (
       );\r
 \r
       FreePool (Configuration);\r
-      Link = GetNextNode (&RootBridgeList, Link);\r
+      Link = RemoveEntryList (Link);\r
       DestroyRootBridge (RootBridgeDev);\r
     }\r
 \r