diff options
Diffstat (limited to 'ipc/shm.c')
-rw-r--r-- | ipc/shm.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -990,6 +990,7 @@ asmlinkage long sys_shmdt(char __user *shmaddr) | |||
990 | */ | 990 | */ |
991 | vma = find_vma(mm, addr); | 991 | vma = find_vma(mm, addr); |
992 | 992 | ||
993 | #ifdef CONFIG_MMU | ||
993 | while (vma) { | 994 | while (vma) { |
994 | next = vma->vm_next; | 995 | next = vma->vm_next; |
995 | 996 | ||
@@ -1034,6 +1035,17 @@ asmlinkage long sys_shmdt(char __user *shmaddr) | |||
1034 | vma = next; | 1035 | vma = next; |
1035 | } | 1036 | } |
1036 | 1037 | ||
1038 | #else /* CONFIG_MMU */ | ||
1039 | /* under NOMMU conditions, the exact address to be destroyed must be | ||
1040 | * given */ | ||
1041 | retval = -EINVAL; | ||
1042 | if (vma->vm_start == addr && vma->vm_ops == &shm_vm_ops) { | ||
1043 | do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start); | ||
1044 | retval = 0; | ||
1045 | } | ||
1046 | |||
1047 | #endif | ||
1048 | |||
1037 | up_write(&mm->mmap_sem); | 1049 | up_write(&mm->mmap_sem); |
1038 | return retval; | 1050 | return retval; |
1039 | } | 1051 | } |