From owner-svn-src-all@FreeBSD.ORG Wed Jul 13 18:35:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6BCC1065677; Wed, 13 Jul 2011 18:35:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6BBD8FC0C; Wed, 13 Jul 2011 18:35:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6DIZlxB095295; Wed, 13 Jul 2011 18:35:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6DIZl3Z095293; Wed, 13 Jul 2011 18:35:47 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107131835.p6DIZl3Z095293@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jul 2011 18:35:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223984 - head/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jul 2011 18:35:47 -0000 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); }