summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_rman.c
diff options
context:
space:
mode:
authortmm <tmm@FreeBSD.org>2003-01-21 17:02:21 +0000
committertmm <tmm@FreeBSD.org>2003-01-21 17:02:21 +0000
commit1c8eb2eca724abf31df71f0061398c68e695f503 (patch)
tree7a9adba9bf5c8fd8b86a77f5f1cdc3e606cf371e /sys/kern/subr_rman.c
parent8f2916a747cee8f6665155e5d88ff983b96edf49 (diff)
downloadFreeBSD-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/kern/subr_rman.c')
-rw-r--r--sys/kern/subr_rman.c2
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);
OpenPOWER on IntegriCloud