diff options
author | tmm <tmm@FreeBSD.org> | 2003-01-21 17:02:21 +0000 |
---|---|---|
committer | tmm <tmm@FreeBSD.org> | 2003-01-21 17:02:21 +0000 |
commit | 1c8eb2eca724abf31df71f0061398c68e695f503 (patch) | |
tree | 7a9adba9bf5c8fd8b86a77f5f1cdc3e606cf371e /sys | |
parent | 8f2916a747cee8f6665155e5d88ff983b96edf49 (diff) | |
download | FreeBSD-src-1c8eb2eca724abf31df71f0061398c68e695f503.zip FreeBSD-src-1c8eb2eca724abf31df71f0061398c68e695f503.tar.gz |
Correct an off-by-one in the boundary check. Otherwise, resource
allocations would fail if the desired allocation size was equal to
the boundary.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/subr_rman.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c index 9ebbfcf..5446039 100644 --- a/sys/kern/subr_rman.c +++ b/sys/kern/subr_rman.c @@ -229,7 +229,7 @@ rman_reserve_resource_bound(struct rman *rm, u_long start, u_long end, */ do { rstart = (rstart + amask) & ~amask; - if (((rstart ^ (rstart + count)) & bmask) != 0) + if (((rstart ^ (rstart + count - 1)) & bmask) != 0) rstart += bound - (rstart & ~bmask); } while ((rstart & amask) != 0 && rstart < end && rstart < s->r_end); |