diff options
Diffstat (limited to 'mm/util.c')
-rw-r--r-- | mm/util.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -355,12 +355,16 @@ unsigned long vm_mmap_pgoff(struct file *file, unsigned long addr, | |||
355 | { | 355 | { |
356 | unsigned long ret; | 356 | unsigned long ret; |
357 | struct mm_struct *mm = current->mm; | 357 | struct mm_struct *mm = current->mm; |
358 | bool populate; | ||
358 | 359 | ||
359 | ret = security_mmap_file(file, prot, flag); | 360 | ret = security_mmap_file(file, prot, flag); |
360 | if (!ret) { | 361 | if (!ret) { |
361 | down_write(&mm->mmap_sem); | 362 | down_write(&mm->mmap_sem); |
362 | ret = do_mmap_pgoff(file, addr, len, prot, flag, pgoff); | 363 | ret = do_mmap_pgoff(file, addr, len, prot, flag, pgoff, |
364 | &populate); | ||
363 | up_write(&mm->mmap_sem); | 365 | up_write(&mm->mmap_sem); |
366 | if (!IS_ERR_VALUE(ret) && populate) | ||
367 | mm_populate(ret, len); | ||
364 | } | 368 | } |
365 | return ret; | 369 | return ret; |
366 | } | 370 | } |