[lkml]   [2003]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] 2.5.63 tsk->usage count.
Hi Linus,
while debugging a memory leak with task structures on s390
I found something related to it. If copy_process fails for some
reason the task structure created with dup_task_struct has set
p->usage to 2 but only one put_task_struct is done in the error
cleanup code. The attached patch should take care of it.

blue skies,

diff -urN linux-2.5/kernel/fork.c linux-2.5-fork/kernel/fork.c
--- linux-2.5/kernel/fork.c Thu Feb 27 11:25:56 2003
+++ linux-2.5-fork/kernel/fork.c Thu Feb 27 10:11:42 2003
@@ -1034,6 +1034,8 @@
+ /* dup_task_struct sets p->usage to 2 */
+ atomic_dec(&p->usage);
goto fork_out;
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:33    [W:0.027 / U:3.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site