diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 309b458e862ae1a151f17aa728023c9a0cbe2d91..762c44981ffd907b53f7f432fe9a891f648da90c 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -591,6 +591,9 @@ u16 pci_find_next_ext_capability(struct pci_dev *dev, u16 start, int cap) return 0; while (ttl-- > 0) { + if (header == 0xffffffff) + return 0; + if (PCI_EXT_CAP_ID(header) == cap && pos != start) return pos;