aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2006-10-17 03:10:33 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-17 11:18:48 -0400
commitbea493a031fe3337f4fe5479e8e865513828ea76 (patch)
treee8876149b729076e0104b59f387e615dcd2e7a76 /kernel/fork.c
parent91b943ee4afa2037678dc1db30b89baef0e17090 (diff)
[PATCH] rt-mutex: fixup rt-mutex debug code
BUG: warning at kernel/rtmutex-debug.c:125/rt_mutex_debug_task_free() (Not tainted) [<c04051e3>] show_trace_log_lvl+0x58/0x16a [<c04057f0>] show_trace+0xd/0x10 [<c0405900>] dump_stack+0x19/0x1b [<c043f03d>] rt_mutex_debug_task_free+0x35/0x6a [<c04224c0>] free_task+0x15/0x24 [<c042378c>] copy_process+0x12bd/0x1324 [<c0423835>] do_fork+0x42/0x113 [<c04021dd>] sys_fork+0x19/0x1b [<c0403fb7>] syscall_call+0x7/0xb In copy_process(), dup_task_struct() also duplicates the ->pi_lock, ->pi_waiters and ->pi_blocked_on members. rt_mutex_debug_task_free() called from free_task() validates these members. However free_task() can be invoked before these members are reset for the new task. Move the initialization code before the first bail that can hit free_task(). Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 7dc6140baac6..29ebb30850ed 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -984,6 +984,8 @@ static struct task_struct *copy_process(unsigned long clone_flags,
984 if (!p) 984 if (!p)
985 goto fork_out; 985 goto fork_out;
986 986
987 rt_mutex_init_task(p);
988
987#ifdef CONFIG_TRACE_IRQFLAGS 989#ifdef CONFIG_TRACE_IRQFLAGS
988 DEBUG_LOCKS_WARN_ON(!p->hardirqs_enabled); 990 DEBUG_LOCKS_WARN_ON(!p->hardirqs_enabled);
989 DEBUG_LOCKS_WARN_ON(!p->softirqs_enabled); 991 DEBUG_LOCKS_WARN_ON(!p->softirqs_enabled);
@@ -1088,8 +1090,6 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1088 p->lockdep_recursion = 0; 1090 p->lockdep_recursion = 0;
1089#endif 1091#endif
1090 1092
1091 rt_mutex_init_task(p);
1092
1093#ifdef CONFIG_DEBUG_MUTEXES 1093#ifdef CONFIG_DEBUG_MUTEXES
1094 p->blocked_on = NULL; /* not blocked yet */ 1094 p->blocked_on = NULL; /* not blocked yet */
1095#endif 1095#endif