diff options
author | Namhyung Kim <namhyung@gmail.com> | 2011-05-24 20:11:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-25 11:39:06 -0400 |
commit | d75a310c42c616c168953ed45c1091074f97828c (patch) | |
tree | 95b4f45787b3d1820987439c8e8bbbbd5158fe14 /mm/nommu.c | |
parent | e922c4c5360980bfeb862b3ec307d36bb344dcae (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 <namhyung@gmail.com>
Acked-by: Greg Ungerer <gerg@uclinux.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/nommu.c')
-rw-r--r-- | mm/nommu.c | 6 |
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, | |||
1635 | int do_munmap(struct mm_struct *mm, unsigned long start, size_t len) | 1635 | int do_munmap(struct mm_struct *mm, unsigned long start, size_t len) |
1636 | { | 1636 | { |
1637 | struct vm_area_struct *vma; | 1637 | struct vm_area_struct *vma; |
1638 | struct rb_node *rb; | ||
1639 | unsigned long end = start + len; | 1638 | unsigned long end = start + len; |
1640 | int ret; | 1639 | int ret; |
1641 | 1640 | ||
@@ -1668,9 +1667,8 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len) | |||
1668 | } | 1667 | } |
1669 | if (end == vma->vm_end) | 1668 | if (end == vma->vm_end) |
1670 | goto erase_whole_vma; | 1669 | goto erase_whole_vma; |
1671 | rb = rb_next(&vma->vm_rb); | 1670 | vma = vma->vm_next; |
1672 | vma = rb_entry(rb, struct vm_area_struct, vm_rb); | 1671 | } while (vma); |
1673 | } while (rb); | ||
1674 | kleave(" = -EINVAL [split file]"); | 1672 | kleave(" = -EINVAL [split file]"); |
1675 | return -EINVAL; | 1673 | return -EINVAL; |
1676 | } else { | 1674 | } else { |