patch-2.2.14 linux/fs/proc/mem.c

Next file: linux/fs/read_write.c
Previous file: linux/fs/proc/array.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.13/linux/fs/proc/mem.c linux/fs/proc/mem.c
@@ -288,11 +288,15 @@
 		if (!dest_table)
 			return -ENOMEM;
 
-		if (!pte_present(*src_table))
-			handle_mm_fault(tsk, src_vma, stmp, 1);
+		if (!pte_present(*src_table)) {
+			if (handle_mm_fault(tsk, src_vma, stmp, 1) < 0)
+				return -ENOMEM;
+		}
 
-		if ((vma->vm_flags & VM_WRITE) && !pte_write(*src_table))
-			handle_mm_fault(tsk, src_vma, stmp, 1);
+		if ((vma->vm_flags & VM_WRITE) && !pte_write(*src_table)) {
+			if (handle_mm_fault(tsk, src_vma, stmp, 1) < 0)
+				return -ENOMEM;
+		}
 
 		set_pte(src_table, pte_mkdirty(*src_table));
 		set_pte(dest_table, *src_table);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)