Index: vm_map.c =================================================================== --- vm_map.c +++ vm_map.c @@ -2868,6 +2868,7 @@ } last_timestamp = map->timestamp; entry = first_entry; + rv = KERN_SUCCESS; while (entry->start < end) { if (entry->eflags & MAP_ENTRY_IN_TRANSITION) { /* @@ -2903,7 +2904,7 @@ } end = saved_start; rv = KERN_INVALID_ADDRESS; - goto done; + break; } } if (entry == first_entry) @@ -2934,7 +2935,7 @@ (entry->end < end && entry->next->start > entry->end)) { end = entry->end; rv = KERN_INVALID_ADDRESS; - goto done; + break; } /* * If system unwiring, require that the entry is system wired. @@ -2943,12 +2944,10 @@ vm_map_entry_system_wired_count(entry) == 0) { end = entry->end; rv = KERN_INVALID_ARGUMENT; - goto done; + break; } entry = entry->next; } - rv = KERN_SUCCESS; -done: need_wakeup = FALSE; if (first_entry == NULL) { result = vm_map_lookup_entry(map, start, &first_entry);