Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jul 2011 18:35:47 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r223984 - head/sys/dev/pci
Message-ID:  <201107131835.p6DIZl3Z095293@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201107131835.p6DIZl3Z095293>