Fix a bug about linked list manipulation in DegradeResource() in PCI bus driver.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9622 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
rsun3 2009-12-29 06:16:29 +00:00
parent de028a62de
commit 4661d5df04
1 changed files with 5 additions and 2 deletions

View File

@ -1050,6 +1050,7 @@ DegradeResource (
PCI_IO_DEVICE *Temp; PCI_IO_DEVICE *Temp;
LIST_ENTRY *ChildDeviceLink; LIST_ENTRY *ChildDeviceLink;
LIST_ENTRY *ChildNodeLink; LIST_ENTRY *ChildNodeLink;
LIST_ENTRY *NextChildNodeLink;
PCI_RESOURCE_NODE *TempNode; PCI_RESOURCE_NODE *TempNode;
// //
@ -1064,12 +1065,13 @@ DegradeResource (
ChildNodeLink = Mem64Node->ChildList.ForwardLink; ChildNodeLink = Mem64Node->ChildList.ForwardLink;
while (ChildNodeLink != &Mem64Node->ChildList) { while (ChildNodeLink != &Mem64Node->ChildList) {
TempNode = RESOURCE_NODE_FROM_LINK (ChildNodeLink); TempNode = RESOURCE_NODE_FROM_LINK (ChildNodeLink);
NextChildNodeLink = ChildNodeLink->ForwardLink;
if (TempNode->PciDev == Temp) { if (TempNode->PciDev == Temp) {
RemoveEntryList (ChildNodeLink); RemoveEntryList (ChildNodeLink);
InsertResourceNode (Mem32Node, TempNode); InsertResourceNode (Mem32Node, TempNode);
} }
ChildNodeLink = TempNode->Link.ForwardLink; ChildNodeLink = NextChildNodeLink;
} }
} }
@ -1077,12 +1079,13 @@ DegradeResource (
ChildNodeLink = PMem64Node->ChildList.ForwardLink; ChildNodeLink = PMem64Node->ChildList.ForwardLink;
while (ChildNodeLink != &PMem64Node->ChildList) { while (ChildNodeLink != &PMem64Node->ChildList) {
TempNode = RESOURCE_NODE_FROM_LINK (ChildNodeLink); TempNode = RESOURCE_NODE_FROM_LINK (ChildNodeLink);
NextChildNodeLink = ChildNodeLink->ForwardLink;
if (TempNode->PciDev == Temp) { if (TempNode->PciDev == Temp) {
RemoveEntryList (ChildNodeLink); RemoveEntryList (ChildNodeLink);
InsertResourceNode (PMem32Node, TempNode); InsertResourceNode (PMem32Node, TempNode);
} }
ChildNodeLink = TempNode->Link.ForwardLink; ChildNodeLink = NextChildNodeLink;
} }
} }