summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorjh <jh@FreeBSD.org>2010-07-08 16:53:19 +0000
committerjh <jh@FreeBSD.org>2010-07-08 16:53:19 +0000
commitf673b7098a7c49e62211c5911f4c7a58e865c8d4 (patch)
tree11240b4d98437eff0b99a69bed900362464706ba /sys/kern
parentbde97d913c06f4be10687aeca2f2cb973d3e5639 (diff)
downloadFreeBSD-src-f673b7098a7c49e62211c5911f4c7a58e865c8d4.zip
FreeBSD-src-f673b7098a7c49e62211c5911f4c7a58e865c8d4.tar.gz
Assert that low and high are >= 0. The allocator doesn't support the
negative range.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_unit.c4
1 files changed, 2 insertions, 2 deletions
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;
OpenPOWER on IntegriCloud