Terminate the Capability List traversal if the Capability Pointer is less than 0x40...
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 21 May 2009 22:26:19 +0000 (22:26 +0000)
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 21 May 2009 22:26:19 +0000 (22:26 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8376 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciCommand.c

index af11143e92af2c66b310be2049dbbcd906572657..31bdd8d23425b33171dd0c8cf634891378d16f96 100644 (file)
@@ -153,11 +153,7 @@ LocateCapabilityRegBlock (
     }\r
   }\r
 \r
-  while (CapabilityPtr > 0x3F) {\r
-    //\r
-    // Mask it to DWORD alignment per PCI spec\r
-    //\r
-    CapabilityPtr &= 0xFC;\r
+  while ((CapabilityPtr >= 0x40) && ((CapabilityPtr & 0x03) == 0x00)) {\r
     PciIoRead (\r
                 &PciIoDevice->PciIo,\r
                 EfiPciIoWidthUint16,\r