diff options
author | marius <marius@FreeBSD.org> | 2011-07-13 18:35:47 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2011-07-13 18:35:47 +0000 |
commit | 0aa6cb935cc47d5432dd4b26d3fcbadacf630000 (patch) | |
tree | b516d22bca3d2d7a3568d9f40e00e5ddbe04ded0 /sys | |
parent | 3e6bbc61ec180456dc5a9230c2a7176def1523ec (diff) | |
download | FreeBSD-src-0aa6cb935cc47d5432dd4b26d3fcbadacf630000.zip FreeBSD-src-0aa6cb935cc47d5432dd4b26d3fcbadacf630000.tar.gz |
PCIB_ALLOC_MSIX() may already fail on the first pass, f.e. when the PCI-PCI
bridge is blacklisted. In that case just return from pci_alloc_msix_method(),
otherwise we continue without a single MSI-X resource, causing subsequent
attempts to use the seemingly available resource to fail or when booting
verbose a NULL-pointer dereference of rle->start when trying to print the
IRQ in pci_alloc_msix_method().
Reviewed by: jhb
MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/pci.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 004190a..7eb84e6 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1353,8 +1353,11 @@ pci_alloc_msix_method(device_t dev, device_t child, int *count) for (i = 0; i < max; i++) { /* Allocate a message. */ error = PCIB_ALLOC_MSIX(device_get_parent(dev), child, &irq); - if (error) + if (error) { + if (i == 0) + return (error); break; + } resource_list_add(&dinfo->resources, SYS_RES_IRQ, i + 1, irq, irq, 1); } |