diff options
author | imp <imp@FreeBSD.org> | 2002-03-13 16:32:11 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2002-03-13 16:32:11 +0000 |
commit | 93a919ffc183c3da766d03e3bfeae79a246f2a3f (patch) | |
tree | ede133a6d47fa0954007582d38037be63f3d1eef /sys/dev/pci/pci.c | |
parent | 7918719dc73ff8f4e35f6f25868c4381e2c91666 (diff) | |
download | FreeBSD-src-93a919ffc183c3da766d03e3bfeae79a246f2a3f.zip FreeBSD-src-93a919ffc183c3da766d03e3bfeae79a246f2a3f.tar.gz |
Add 5th parameter to pci_read_device specifying the size of the object
to create.
Diffstat (limited to 'sys/dev/pci/pci.c')
-rw-r--r-- | sys/dev/pci/pci.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 7a758ae..af6500b 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -310,7 +310,7 @@ pci_hdrtypedata(device_t pcib, int b, int s, int f, pcicfgregs *cfg) /* read configuration header into pcicfgregs structure */ struct pci_devinfo * -pci_read_device(device_t pcib, int b, int s, int f) +pci_read_device(device_t pcib, int b, int s, int f, size_t size) { #define REG(n, w) PCIB_READ_CONFIG(pcib, b, s, f, n, w) pcicfgregs *cfg = NULL; @@ -322,8 +322,7 @@ pci_read_device(device_t pcib, int b, int s, int f) devlist_entry = NULL; if (PCIB_READ_CONFIG(pcib, b, s, f, PCIR_DEVVENDOR, 4) != -1) { - devlist_entry = malloc(sizeof(struct pci_devinfo), - M_DEVBUF, M_WAITOK | M_ZERO); + devlist_entry = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO); if (devlist_entry == NULL) return (NULL); @@ -779,8 +778,8 @@ pci_add_children(device_t dev, int busno) for (s = 0; s <= maxslots; s++) { int pcifunchigh = 0; for (f = 0; f <= pcifunchigh; f++) { - struct pci_devinfo *dinfo = - pci_read_device(pcib, busno, s, f); + struct pci_devinfo *dinfo = pci_read_device(pcib, + busno, s, f, sizeof(struct pci_devinfo)); if (dinfo != NULL) { if (dinfo->cfg.mfdev) pcifunchigh = PCI_FUNCMAX; |