patch-2.3.99-pre7 linux/kernel/ptrace.c

Next file: linux/kernel/sched.c
Previous file: linux/kernel/ksyms.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre6/linux/kernel/ptrace.c linux/kernel/ptrace.c
@@ -121,10 +121,13 @@
 	struct vm_area_struct * vma;
 
 	/* Worry about races with exit() */
-	lock_kernel();
+	task_lock(tsk);
 	mm = tsk->mm;
-	atomic_inc(&mm->mm_users);
-	unlock_kernel();
+	if (mm)
+		atomic_inc(&mm->mm_users);
+	task_unlock(tsk);
+	if (!mm)
+		return 0;
 
 	down(&mm->mmap_sem);
 	vma = find_extend_vma(mm, addr);

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