Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Jul 2017 16:55:56 +0000 (UTC)
From:      Scott Long <scottl@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r321799 - in head/sys/dev: mpr mps
Message-ID:  <201707311655.v6VGtuEC036440@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: scottl
Date: Mon Jul 31 16:55:56 2017
New Revision: 321799
URL: https://svnweb.freebsd.org/changeset/base/321799

Log:
  Fix a logic bug in the split PCI interrupt code that slipped through
  
  Reported by:	Harry Schmalzbauer

Modified:
  head/sys/dev/mpr/mpr_pci.c
  head/sys/dev/mps/mps_pci.c

Modified: head/sys/dev/mpr/mpr_pci.c
==============================================================================
--- head/sys/dev/mpr/mpr_pci.c	Mon Jul 31 16:46:16 2017	(r321798)
+++ head/sys/dev/mpr/mpr_pci.c	Mon Jul 31 16:55:56 2017	(r321799)
@@ -260,6 +260,7 @@ mpr_pci_alloc_interrupts(struct mpr_softc *sc)
 
 	dev = sc->mpr_dev;
 	error = 0;
+	msgs = 0;
 
 	if ((sc->disable_msix == 0) &&
 	    ((msgs = pci_msix_count(dev)) >= MPR_MSI_COUNT))
@@ -267,7 +268,7 @@ mpr_pci_alloc_interrupts(struct mpr_softc *sc)
 	if ((error != 0) && (sc->disable_msi == 0) &&
 	    ((msgs = pci_msi_count(dev)) >= MPR_MSI_COUNT))
 		error = mpr_alloc_msi(sc, MPR_MSI_COUNT);
-	else
+	if (error != 0)
 		msgs = 0;
 
 	sc->msi_msgs = msgs;

Modified: head/sys/dev/mps/mps_pci.c
==============================================================================
--- head/sys/dev/mps/mps_pci.c	Mon Jul 31 16:46:16 2017	(r321798)
+++ head/sys/dev/mps/mps_pci.c	Mon Jul 31 16:55:56 2017	(r321799)
@@ -245,6 +245,7 @@ mps_pci_alloc_interrupts(struct mps_softc *sc)
 
 	dev = sc->mps_dev;
 	error = 0;
+	msgs = 0;
 
 	if ((sc->disable_msix == 0) &&
 	    ((msgs = pci_msix_count(dev)) >= MPS_MSI_COUNT))
@@ -252,7 +253,7 @@ mps_pci_alloc_interrupts(struct mps_softc *sc)
 	if ((error != 0) && (sc->disable_msi == 0) &&
 	    ((msgs = pci_msi_count(dev)) >= MPS_MSI_COUNT))
 		error = mps_alloc_msi(sc, MPS_MSI_COUNT);
-	else
+	if (error != 0)
 		msgs = 0;
 
 	sc->msi_msgs = msgs;



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