X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fcaps.c;h=9a2e0a5f1291cf67cf8a1ac136311bae2ccb7d11;hb=d9b1b8e350adbaf97713ce50b044f1c63d6a98cf;hp=13e395617758ad90befac56c4d31e8b6ecffc258;hpb=6d5e39acd6ad8eb295442f127df2216d3ed992f9;p=pciutils.git diff --git a/lib/caps.c b/lib/caps.c index 13e3956..9a2e0a5 100644 --- a/lib/caps.c +++ b/lib/caps.c @@ -71,7 +71,7 @@ pci_scan_ext_caps(struct pci_dev *d) if (been_there[where]++) break; pci_add_cap(d, where, id, PCI_CAP_EXTENDED); - where = header >> 20; + where = (header >> 20) & ~3; } while (where); } @@ -96,8 +96,8 @@ pci_free_caps(struct pci_dev *d) while (cap = d->first_cap) { - d->first_cap = cap; - pci_mfree(d); + d->first_cap = cap->next; + pci_mfree(cap); } } @@ -106,7 +106,7 @@ pci_find_cap(struct pci_dev *d, unsigned int id, unsigned int type) { struct pci_cap *c; - pci_fill_info(d, ((type == PCI_CAP_NORMAL) ? PCI_FILL_CAPS : PCI_FILL_EXT_CAPS)); + pci_fill_info_v35(d, ((type == PCI_CAP_NORMAL) ? PCI_FILL_CAPS : PCI_FILL_EXT_CAPS)); for (c=d->first_cap; c; c=c->next) if (c->type == type && c->id == id) return c;