aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ramfs/file-nommu.c7
-rw-r--r--ipc/shm.c2
2 files changed, 8 insertions, 1 deletions
diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c
index cad2b7ace630..237fe8b8e819 100644
--- a/fs/ramfs/file-nommu.c
+++ b/fs/ramfs/file-nommu.c
@@ -295,5 +295,10 @@ unsigned long ramfs_nommu_get_unmapped_area(struct file *file,
295 */ 295 */
296int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma) 296int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma)
297{ 297{
298 return vma->vm_flags & VM_SHARED ? 0 : -ENOSYS; 298 if (!(vma->vm_flags & VM_SHARED))
299 return -ENOSYS;
300
301 file_accessed(file);
302 vma->vm_ops = &generic_file_vm_ops;
303 return 0;
299} 304}
diff --git a/ipc/shm.c b/ipc/shm.c
index d0259e3ad1c0..d88ac5a07ec7 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -268,7 +268,9 @@ static int shm_mmap(struct file * file, struct vm_area_struct * vma)
268 if (ret != 0) 268 if (ret != 0)
269 return ret; 269 return ret;
270 sfd->vm_ops = vma->vm_ops; 270 sfd->vm_ops = vma->vm_ops;
271#ifdef CONFIG_MMU
271 BUG_ON(!sfd->vm_ops->fault); 272 BUG_ON(!sfd->vm_ops->fault);
273#endif
272 vma->vm_ops = &shm_vm_ops; 274 vma->vm_ops = &shm_vm_ops;
273 shm_open(vma); 275 shm_open(vma);
274 276