Author: marius
Date: Wed Jul 13 18:35:47 2011
New Revision: 223984
URL: http://svn.freebsd.org/changeset/base/223984

Log:
  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

Modified:
  head/sys/dev/pci/pci.c

Modified: head/sys/dev/pci/pci.c
==============================================================================
--- head/sys/dev/pci/pci.c      Wed Jul 13 17:38:42 2011        (r223983)
+++ head/sys/dev/pci/pci.c      Wed Jul 13 18:35:47 2011        (r223984)
@@ -1353,8 +1353,11 @@ pci_alloc_msix_method(device_t dev, devi
        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);
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to