diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2015-02-09 07:14:39 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2015-02-09 07:14:39 +0000 |
commit | 7ed6b6bcae9db4769abf7f0831bc5412aa6db989 (patch) | |
tree | f2a9c92e8320b3c046cd2fb866ab8f32aa138a5f /sys/uvm | |
parent | abbc59398716dbc18f480e3c9b92d792d80c3ac5 (diff) |
Make sure we actually have an entry before checking its limits.
ok deraadt@
Diffstat (limited to 'sys/uvm')
-rw-r--r-- | sys/uvm/uvm_map.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c index d12e6aef653..16bbdb396a8 100644 --- a/sys/uvm/uvm_map.c +++ b/sys/uvm/uvm_map.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_map.c,v 1.184 2015/02/06 11:41:55 beck Exp $ */ +/* $OpenBSD: uvm_map.c,v 1.185 2015/02/09 07:14:38 kettenis Exp $ */ /* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */ /* @@ -4175,7 +4175,7 @@ uvm_map_clean(struct vm_map *map, vaddr_t start, vaddr_t end, int flags) first = uvm_map_entrybyaddr(&map->addr, start); /* Make a first pass to check for holes. */ - for (entry = first; entry->start < end; + for (entry = first; entry != NULL && entry->start < end; entry = RB_NEXT(uvm_map_addr, &map->addr, entry)) { if (UVM_ET_ISSUBMAP(entry)) { vm_map_unlock_read(map); |