diff options
author | jh <jh@FreeBSD.org> | 2010-07-08 16:53:19 +0000 |
---|---|---|
committer | jh <jh@FreeBSD.org> | 2010-07-08 16:53:19 +0000 |
commit | f673b7098a7c49e62211c5911f4c7a58e865c8d4 (patch) | |
tree | 11240b4d98437eff0b99a69bed900362464706ba /sys | |
parent | bde97d913c06f4be10687aeca2f2cb973d3e5639 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | sys/kern/subr_unit.c | 4 |
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; |