aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/boot/ofw/libofw/ofw_copy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/boot/ofw/libofw/ofw_copy.c b/sys/boot/ofw/libofw/ofw_copy.c
index 93e7ec656d04..781d4233a014 100644
--- a/sys/boot/ofw/libofw/ofw_copy.c
+++ b/sys/boot/ofw/libofw/ofw_copy.c
@@ -68,7 +68,7 @@ ofw_mapmem(vm_offset_t dest, const size_t len)
/*
* Trim area covered by existing mapping, if any
*/
- if (dest < (last_dest + last_len)) {
+ if (dest < (last_dest + last_len) && dest >= last_dest) {
nlen -= (last_dest + last_len) - dest;
dest = last_dest + last_len;
}