From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 16:53:19 2010 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 857D81065674; Thu, 8 Jul 2010 16:53:19 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75D148FC1B; Thu, 8 Jul 2010 16:53:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68GrJ2T069444; Thu, 8 Jul 2010 16:53:19 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68GrJ73069442; Thu, 8 Jul 2010 16:53:19 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201007081653.o68GrJ73069442@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 8 Jul 2010 16:53:19 +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: r209816 - head/sys/kern 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: Thu, 08 Jul 2010 16:53:19 -0000 Author: jh Date: Thu Jul 8 16:53:19 2010 New Revision: 209816 URL: http://svn.freebsd.org/changeset/base/209816 Log: Assert that low and high are >= 0. The allocator doesn't support the negative range. Modified: head/sys/kern/subr_unit.c Modified: head/sys/kern/subr_unit.c ============================================================================== --- head/sys/kern/subr_unit.c Thu Jul 8 16:11:06 2010 (r209815) +++ head/sys/kern/subr_unit.c Thu Jul 8 16:53:19 2010 (r209816) @@ -326,8 +326,8 @@ new_unrhdr(int low, int high, struct mtx { struct unrhdr *uh; - KASSERT(low <= high, - ("UNR: use error: new_unrhdr(%u, %u)", low, high)); + KASSERT(low >= 0 && high >= 0 && low <= high, + ("UNR: use error: new_unrhdr(%d, %d)", low, high)); uh = Malloc(sizeof *uh); if (mutex != NULL) uh->mtx = mutex;