summaryrefslogtreecommitdiff
path: root/sys/vm
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2007-10-31 02:31:51 +0000
committerAlan Cox <alc@FreeBSD.org>2007-10-31 02:31:51 +0000
commit23456847558f4a9d4a00ebdb005603cf38eac8cf (patch)
tree666ed5581c82592e39924ad722bcb9e3dedb34b1 /sys/vm
parenta9eef3af45d96d0c9f7dbe706e2fa8061d86ae05 (diff)
Notes
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_map.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index cc6628b75451..4b31fb39140c 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -2204,7 +2204,8 @@ vm_map_sync(
/*
* Make a first pass to check for user-wired memory and holes.
*/
- for (current = entry; current->start < end; current = current->next) {
+ for (current = entry; current != &map->header && current->start < end;
+ current = current->next) {
if (invalidate && (current->eflags & MAP_ENTRY_USER_WIRED)) {
vm_map_unlock_read(map);
return (KERN_INVALID_ARGUMENT);
@@ -2224,7 +2225,8 @@ vm_map_sync(
* Make a second pass, cleaning/uncaching pages from the indicated
* objects as we go.
*/
- for (current = entry; current->start < end; current = current->next) {
+ for (current = entry; current != &map->header && current->start < end;
+ current = current->next) {
offset = current->offset + (start - current->start);
size = (end <= current->end ? end : current->end) - start;
if (current->eflags & MAP_ENTRY_IS_SUB_MAP) {