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);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to