Revision: 18475
http://sourceforge.net/p/edk2/code/18475
Author: hwu1225
Date: 2015-09-15 08:47:05 +0000 (Tue, 15 Sep 2015)
Log Message:
-----------
MdeModulePkg: Enhance PCI capability looking up logic to avoid hang
Certain PCI device may have capability pointing to itself.
Update LocateCapabilityRegBlock() to break when detecting such loop.
(Sync patch r18473 from main trunk.)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <[email protected]>
Reviewed-by: Feng Tian <[email protected]>
Revision Links:
--------------
http://sourceforge.net/p/edk2/code/18473
Modified Paths:
--------------
branches/UDK2015/MdeModulePkg/Bus/Pci/PciBusDxe/PciCommand.c
Modified: branches/UDK2015/MdeModulePkg/Bus/Pci/PciBusDxe/PciCommand.c
===================================================================
--- branches/UDK2015/MdeModulePkg/Bus/Pci/PciBusDxe/PciCommand.c
2015-09-15 08:46:29 UTC (rev 18474)
+++ branches/UDK2015/MdeModulePkg/Bus/Pci/PciBusDxe/PciCommand.c
2015-09-15 08:47:05 UTC (rev 18475)
@@ -173,6 +173,14 @@
return EFI_SUCCESS;
}
+ //
+ // Certain PCI device may incorrectly have capability pointing to itself,
+ // break to avoid dead loop.
+ //
+ if (CapabilityPtr == (UINT8) (CapabilityEntry >> 8)) {
+ break;
+ }
+
CapabilityPtr = (UINT8) (CapabilityEntry >> 8);
}
------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits