From f673b7098a7c49e62211c5911f4c7a58e865c8d4 Mon Sep 17 00:00:00 2001 From: jh Date: Thu, 8 Jul 2010 16:53:19 +0000 Subject: Assert that low and high are >= 0. The allocator doesn't support the negative range. --- sys/kern/subr_unit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/kern') diff --git a/sys/kern/subr_unit.c b/sys/kern/subr_unit.c index 84e7227..a66d9e9 100644 --- a/sys/kern/subr_unit.c +++ b/sys/kern/subr_unit.c @@ -326,8 +326,8 @@ new_unrhdr(int low, int high, struct mtx *mutex) { 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; -- cgit v1.1