aboutsummaryrefslogtreecommitdiffstats
path: root/mm/fremap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/fremap.c')
-rw-r--r--mm/fremap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/fremap.c b/mm/fremap.c
index 14bd3bf7826e..69a37c2bdf81 100644
--- a/mm/fremap.c
+++ b/mm/fremap.c
@@ -190,10 +190,13 @@ asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size,
190 */ 190 */
191 if (mapping_cap_account_dirty(mapping)) { 191 if (mapping_cap_account_dirty(mapping)) {
192 unsigned long addr; 192 unsigned long addr;
193 struct file *file = vma->vm_file;
193 194
194 flags &= MAP_NONBLOCK; 195 flags &= MAP_NONBLOCK;
195 addr = mmap_region(vma->vm_file, start, size, 196 get_file(file);
197 addr = mmap_region(file, start, size,
196 flags, vma->vm_flags, pgoff, 1); 198 flags, vma->vm_flags, pgoff, 1);
199 fput(file);
197 if (IS_ERR_VALUE(addr)) { 200 if (IS_ERR_VALUE(addr)) {
198 err = addr; 201 err = addr;
199 } else { 202 } else {