summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/subr_rman.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c
index 85af088..7c5502e 100644
--- a/sys/kern/subr_rman.c
+++ b/sys/kern/subr_rman.c
@@ -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));
OpenPOWER on IntegriCloud