aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNamhyung Kim <[email protected]>2011-05-24 17:11:25 -0700
committerLinus Torvalds <[email protected]>2011-05-25 08:39:06 -0700
commitd75a310c42c616c168953ed45c1091074f97828c (patch)
tree95b4f45787b3d1820987439c8e8bbbbd5158fe14
parente922c4c5360980bfeb862b3ec307d36bb344dcae (diff)
mm: nommu: check the vma list when unmapping file-mapped vma
Now we have the sorted vma list, use it in do_munmap() to check that we have an exact match. Signed-off-by: Namhyung Kim <[email protected]> Acked-by: Greg Ungerer <[email protected]> Cc: David Howells <[email protected]> Cc: Paul Mundt <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/nommu.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/mm/nommu.c b/mm/nommu.c
index e5318f8efde5..0563fd9003df 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -1635,7 +1635,6 @@ static int shrink_vma(struct mm_struct *mm,
int do_munmap(struct mm_struct *mm, unsigned long start, size_t len)
{
struct vm_area_struct *vma;
- struct rb_node *rb;
unsigned long end = start + len;
int ret;
@@ -1668,9 +1667,8 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len)
}
if (end == vma->vm_end)
goto erase_whole_vma;
- rb = rb_next(&vma->vm_rb);
- vma = rb_entry(rb, struct vm_area_struct, vm_rb);
- } while (rb);
+ vma = vma->vm_next;
+ } while (vma);
kleave(" = -EINVAL [split file]");
return -EINVAL;
} else {