aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/nommu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/nommu.c b/mm/nommu.c
index 3fba2dc97c44..e544508e2a4b 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -1016,7 +1016,7 @@ static int validate_mmap_request(struct file *file,
1016 * device */ 1016 * device */
1017 if (!file->f_op->get_unmapped_area) 1017 if (!file->f_op->get_unmapped_area)
1018 capabilities &= ~NOMMU_MAP_DIRECT; 1018 capabilities &= ~NOMMU_MAP_DIRECT;
1019 if (!file->f_op->read) 1019 if (!(file->f_mode & FMODE_CAN_READ))
1020 capabilities &= ~NOMMU_MAP_COPY; 1020 capabilities &= ~NOMMU_MAP_COPY;
1021 1021
1022 /* The file shall have been opened with read permission. */ 1022 /* The file shall have been opened with read permission. */
@@ -1240,7 +1240,7 @@ static int do_mmap_private(struct vm_area_struct *vma,
1240 1240
1241 old_fs = get_fs(); 1241 old_fs = get_fs();
1242 set_fs(KERNEL_DS); 1242 set_fs(KERNEL_DS);
1243 ret = vma->vm_file->f_op->read(vma->vm_file, base, len, &fpos); 1243 ret = __vfs_read(vma->vm_file, base, len, &fpos);
1244 set_fs(old_fs); 1244 set_fs(old_fs);
1245 1245
1246 if (ret < 0) 1246 if (ret < 0)