Add sanity check seeing if adjusted start address exceeds end address

after boundary and alignment adjustment.
This commit is contained in:
iwasaki 2002-08-29 12:39:21 +00:00
parent f8c5ceb68d
commit f3872b5db5

View File

@ -232,6 +232,10 @@ rman_reserve_resource_bound(struct rman *rm, u_long start, u_long end,
} while ((rstart & amask) != 0 && rstart < end &&
rstart < s->r_end);
rend = ulmin(s->r_end, ulmax(rstart + count, end));
if (rstart > rend) {
DPRINTF(("adjusted start exceeds end\n"));
continue;
}
DPRINTF(("truncated region: [%#lx, %#lx]; size %#lx (requested %#lx)\n",
rstart, rend, (rend - rstart + 1), count));