---

 25-akpm/ipc/shm.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff -puN ipc/shm.c~shm-do_munmap-check ipc/shm.c
--- 25/ipc/shm.c~shm-do_munmap-check	2004-04-27 20:37:44.112233792 -0700
+++ 25-akpm/ipc/shm.c	2004-04-27 20:37:44.116233184 -0700
@@ -796,10 +796,12 @@ asmlinkage long sys_shmdt(char __user *s
 		 */
 		if ((vma->vm_ops == &shm_vm_ops || is_vm_hugetlb_page(vma)) &&
 			(vma->vm_start - addr)/PAGE_SIZE == vma->vm_pgoff) {
-
+			int ret;
 
 			size = vma->vm_file->f_dentry->d_inode->i_size;
-			do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start);
+			ret = do_munmap(mm, vma->vm_start,
+					vma->vm_end - vma->vm_start);
+			WARN_ON(ret);
 			/*
 			 * We discovered the size of the shm segment, so
 			 * break out of here and fall through to the next
@@ -823,9 +825,13 @@ asmlinkage long sys_shmdt(char __user *s
 
 		/* finding a matching vma now does not alter retval */
 		if ((vma->vm_ops == &shm_vm_ops || is_vm_hugetlb_page(vma)) &&
-			(vma->vm_start - addr)/PAGE_SIZE == vma->vm_pgoff)
+			(vma->vm_start - addr)/PAGE_SIZE == vma->vm_pgoff) {
+			int ret;
 
-			do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start);
+			ret = do_munmap(mm, vma->vm_start,
+					vma->vm_end - vma->vm_start);
+			WARN_ON(ret);
+		}
 		vma = next;
 	}
 

_
