From 72aeb19abaed6411ef4901319d26f071c932d8ef Mon Sep 17 00:00:00 2001 From: Thomas Moestl Date: Tue, 21 Jan 2003 17:02:21 +0000 Subject: [PATCH] Correct an off-by-one in the boundary check. Otherwise, resource allocations would fail if the desired allocation size was equal to the boundary. --- sys/kern/subr_rman.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c index 9ebbfcf3b01..54460396833 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);