Correct an off-by-one in the boundary check. Otherwise, resource

allocations would fail if the desired allocation size was equal to
the boundary.
This commit is contained in:
Thomas Moestl 2003-01-21 17:02:21 +00:00
parent 93001c7214
commit 72aeb19aba

View File

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