Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Mar 2009 11:12:23 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r189530 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern
Message-ID:  <200903081112.n28BCNTP081886@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Sun Mar  8 11:12:23 2009
New Revision: 189530
URL: http://svn.freebsd.org/changeset/base/189530

Log:
  MFC r189232, r189313:
  Fix range-check error introduced in r182292.
  Panic in case the ncpus == 0. it helps to catch bugs in the callers.
  
  Approved by:	kib (mentor)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/kern/subr_smp.c

Modified: stable/7/sys/kern/subr_smp.c
==============================================================================
--- stable/7/sys/kern/subr_smp.c	Sun Mar  8 10:58:37 2009	(r189529)
+++ stable/7/sys/kern/subr_smp.c	Sun Mar  8 11:12:23 2009	(r189530)
@@ -358,9 +358,11 @@ smp_rendezvous_cpus(cpumask_t map,
 		return;
 	}
 
-	for (i = 0; i < mp_maxid; i++)
+	for (i = 0; i <= mp_maxid; i++)
 		if (((1 << i) & map) != 0 && !CPU_ABSENT(i))
 			ncpus++;
+	if (ncpus == 0)
+		panic("ncpus is 0 with map=0x%x", map);
 
 	/* obtain rendezvous lock */
 	mtx_lock_spin(&smp_ipi_mtx);



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