From 8738ef6cad0cd497a8be8cf00ee61b02dc23b79d Mon Sep 17 00:00:00 2001 From: Chris Wright Date: Tue, 21 Jun 2005 17:14:52 -0700 Subject: [PATCH] --- yaml --- r: 2450 b: refs/heads/master c: 73219d178051691a56d57184d8c7f6d0cbe3c5c1 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/mm/mmap.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index fb2898da2b76..732fd18fc980 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1363c3cd8603a913a27e2995dccbd70d5312d8e6 +refs/heads/master: 73219d178051691a56d57184d8c7f6d0cbe3c5c1 diff --git a/trunk/mm/mmap.c b/trunk/mm/mmap.c index 9da23c1ef9dc..da3fa90a0aae 100644 --- a/trunk/mm/mmap.c +++ b/trunk/mm/mmap.c @@ -1267,6 +1267,9 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, return (mm->free_area_cache = addr-len); } + if (mm->mmap_base < len) + goto bottomup; + addr = mm->mmap_base-len; do { @@ -1288,6 +1291,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, addr = vma->vm_start-len; } while (len < vma->vm_start); +bottomup: /* * A failed mmap() very likely causes application failure, * so fall back to the bottom-up function here. This scenario