svn commit: r209816 - head/sys/kern

Jaakko Heinonen jh at FreeBSD.org
Thu Jul 8 16:53:19 UTC 2010


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;


More information about the svn-src-head mailing list