summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2009-05-21 22:25:38 +0000
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2009-05-21 22:25:38 +0000
commit94853f20f34fdce04673c734366d3a53af498325 (patch)
treedd7013f260299fdd8aa5f192aca328c490f7c802
parent20610fa85c3a0f1fac5cb86e969c3053de08237b (diff)
downloadedk2-94853f20f34fdce04673c734366d3a53af498325.zip
edk2-94853f20f34fdce04673c734366d3a53af498325.tar.gz
edk2-94853f20f34fdce04673c734366d3a53af498325.tar.bz2
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@8375 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--DuetPkg/PciBusNoEnumerationDxe/PciCommand.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/DuetPkg/PciBusNoEnumerationDxe/PciCommand.c b/DuetPkg/PciBusNoEnumerationDxe/PciCommand.c
index 6d524c1..58b482c 100644
--- a/DuetPkg/PciBusNoEnumerationDxe/PciCommand.c
+++ b/DuetPkg/PciBusNoEnumerationDxe/PciCommand.c
@@ -433,11 +433,7 @@ Returns:
}
}
- while (CapabilityPtr > 0x3F) {
- //
- // Mask it to DWORD alignment per PCI spec
- //
- CapabilityPtr &= 0xFC;
+ while ((CapabilityPtr >= 0x40) && ((CapabilityPtr & 0x03) == 0x00)) {
PciIoDevice->PciIo.Pci.Read (
&PciIoDevice->PciIo,
EfiPciIoWidthUint16,