summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2009-05-21 22:26:19 +0000
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2009-05-21 22:26:19 +0000
commitf680f867cee25f6aad522d7e3960c0046c3bba61 (patch)
treed48eecd7a510fccc38a74ee513382166d9d1bd0a
parent94853f20f34fdce04673c734366d3a53af498325 (diff)
downloadedk2-platforms-f680f867cee25f6aad522d7e3960c0046c3bba61.tar.xz
Terminate the Capability List traversal if the Capability Pointer is less than 0x40, or the Capability Pointer is not aligned on a 32-bit boundary.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8376 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciCommand.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciCommand.c b/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciCommand.c
index af11143e92..31bdd8d234 100644
--- a/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciCommand.c
+++ b/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciCommand.c
@@ -153,11 +153,7 @@ LocateCapabilityRegBlock (
}
}
- while (CapabilityPtr > 0x3F) {
- //
- // Mask it to DWORD alignment per PCI spec
- //
- CapabilityPtr &= 0xFC;
+ while ((CapabilityPtr >= 0x40) && ((CapabilityPtr & 0x03) == 0x00)) {
PciIoRead (
&PciIoDevice->PciIo,
EfiPciIoWidthUint16,