From owner-svn-src-stable@FreeBSD.ORG Sun Mar 8 11:12:23 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC27C1065670; Sun, 8 Mar 2009 11:12:23 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C95BE8FC0A; Sun, 8 Mar 2009 11:12:23 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n28BCN1W081887; Sun, 8 Mar 2009 11:12:23 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n28BCNTP081886; Sun, 8 Mar 2009 11:12:23 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <200903081112.n28BCNTP081886@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 8 Mar 2009 11:12:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189530 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2009 11:12:24 -0000 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);