Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 288287
b: refs/heads/master
c: 83cd904
h: refs/heads/master
i:
  288285: ddc0889
  288283: e39cef9
  288279: 29a86d9
  288271: c5d6317
  288255: 5852ec8
v: v3
  • Loading branch information
Mikulas Patocka authored and Linus Torvalds committed Mar 7, 2012
1 parent 0ec4e5f commit 5d4ae2c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 52abb700e16a9aa4cbc03f3d7f80206cbbc80680
refs/heads/master: 83cd904d271ba960c53f3adbb037f3486518f1e6
12 changes: 10 additions & 2 deletions trunk/mm/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,6 @@ EXPORT_SYMBOL(find_vma);

/*
* Same as find_vma, but also return a pointer to the previous VMA in *pprev.
* Note: pprev is set to NULL when return value is NULL.
*/
struct vm_area_struct *
find_vma_prev(struct mm_struct *mm, unsigned long addr,
Expand All @@ -1617,7 +1616,16 @@ find_vma_prev(struct mm_struct *mm, unsigned long addr,
struct vm_area_struct *vma;

vma = find_vma(mm, addr);
*pprev = vma ? vma->vm_prev : NULL;
if (vma) {
*pprev = vma->vm_prev;
} else {
struct rb_node *rb_node = mm->mm_rb.rb_node;
*pprev = NULL;
while (rb_node) {
*pprev = rb_entry(rb_node, struct vm_area_struct, vm_rb);
rb_node = rb_node->rb_right;
}
}
return vma;
}

Expand Down

0 comments on commit 5d4ae2c

Please sign in to comment.