diff options
-rw-r--r-- | kernel/trace/ftrace.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 1664d3f33d38..bb081f37cac7 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -2738,6 +2738,9 @@ void unregister_ftrace_graph(void) | |||
2738 | /* Allocate a return stack for newly created task */ | 2738 | /* Allocate a return stack for newly created task */ |
2739 | void ftrace_graph_init_task(struct task_struct *t) | 2739 | void ftrace_graph_init_task(struct task_struct *t) |
2740 | { | 2740 | { |
2741 | /* Make sure we do not use the parent ret_stack */ | ||
2742 | t->ret_stack = NULL; | ||
2743 | |||
2741 | if (atomic_read(&ftrace_graph_active)) { | 2744 | if (atomic_read(&ftrace_graph_active)) { |
2742 | struct ftrace_ret_stack *ret_stack; | 2745 | struct ftrace_ret_stack *ret_stack; |
2743 | 2746 | ||
@@ -2753,8 +2756,7 @@ void ftrace_graph_init_task(struct task_struct *t) | |||
2753 | /* make curr_ret_stack visable before we add the ret_stack */ | 2756 | /* make curr_ret_stack visable before we add the ret_stack */ |
2754 | smp_wmb(); | 2757 | smp_wmb(); |
2755 | t->ret_stack = ret_stack; | 2758 | t->ret_stack = ret_stack; |
2756 | } else | 2759 | } |
2757 | t->ret_stack = NULL; | ||
2758 | } | 2760 | } |
2759 | 2761 | ||
2760 | void ftrace_graph_exit_task(struct task_struct *t) | 2762 | void ftrace_graph_exit_task(struct task_struct *t) |