Assert that low and high are >= 0. The allocator doesn't support the

negative range.
This commit is contained in:
Jaakko Heinonen 2010-07-08 16:53:19 +00:00
parent 9132d3f5b0
commit 501812f2c5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=209816

View File

@ -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;