aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/madvise.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/madvise.c b/mm/madvise.c
index 4e196155a0c3..77916e9fc52b 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -155,11 +155,14 @@ static long madvise_dontneed(struct vm_area_struct * vma,
155 * Other filesystems return -ENOSYS. 155 * Other filesystems return -ENOSYS.
156 */ 156 */
157static long madvise_remove(struct vm_area_struct *vma, 157static long madvise_remove(struct vm_area_struct *vma,
158 struct vm_area_struct **prev,
158 unsigned long start, unsigned long end) 159 unsigned long start, unsigned long end)
159{ 160{
160 struct address_space *mapping; 161 struct address_space *mapping;
161 loff_t offset, endoff; 162 loff_t offset, endoff;
162 163
164 *prev = vma;
165
163 if (vma->vm_flags & (VM_LOCKED|VM_NONLINEAR|VM_HUGETLB)) 166 if (vma->vm_flags & (VM_LOCKED|VM_NONLINEAR|VM_HUGETLB))
164 return -EINVAL; 167 return -EINVAL;
165 168
@@ -199,7 +202,7 @@ madvise_vma(struct vm_area_struct *vma, struct vm_area_struct **prev,
199 error = madvise_behavior(vma, prev, start, end, behavior); 202 error = madvise_behavior(vma, prev, start, end, behavior);
200 break; 203 break;
201 case MADV_REMOVE: 204 case MADV_REMOVE:
202 error = madvise_remove(vma, start, end); 205 error = madvise_remove(vma, prev, start, end);
203 break; 206 break;
204 207
205 case MADV_WILLNEED: 208 case MADV_WILLNEED: