Previously, vm_map_enter returned KERN_NO_SPACE if ADDRESS is out of
range even if ANYWHERE was given.

* vm/vm_map.c (vm_map_enter): Pick a suitable address if the given
address is out of bounds and anywhere is given.
---
 vm/vm_map.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/vm/vm_map.c b/vm/vm_map.c
index 6b13724..fe4aae1 100644
--- a/vm/vm_map.c
+++ b/vm/vm_map.c
@@ -781,10 +781,8 @@ kern_return_t vm_map_enter(
                 *      Calculate the first possible address.
                 */
 
-               if (start < map->min_offset)
+               if (start < map->min_offset || start > map->max_offset)
                        start = map->min_offset;
-               if (start > map->max_offset)
-                       RETURN(KERN_NO_SPACE);
 
                /*
                 *      Look for the first possible address;
-- 
2.1.0


Reply via email to