diff options
author | Zhaolei <zhaolei@cn.fujitsu.com> | 2009-03-13 05:14:01 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-13 05:25:06 -0400 |
commit | b00f0b6dc1773b4c8f538503247da050b5ea631b (patch) | |
tree | 94c81517cb3d1def0c0f9ccb33c48fb03c0f1c75 /kernel/trace/ftrace.c | |
parent | 62a394eb77a1ddea73273f53ed8c3ccf6e04f2fb (diff) |
ftrace: avoid double-free of dyn_ftrace
If dyn_ftrace is freed before ftrace_release(), ftrace_release()
will free it again and make ftrace_free_records wrong.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Cc: "Steven Rostedt ;" <rostedt@goodmis.org>
LKML-Reference: <49BA23D9.1050900@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r-- | kernel/trace/ftrace.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index d33d306bdcf4..26c45aaf6805 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -356,7 +356,8 @@ void ftrace_release(void *start, unsigned long size) | |||
356 | 356 | ||
357 | mutex_lock(&ftrace_lock); | 357 | mutex_lock(&ftrace_lock); |
358 | do_for_each_ftrace_rec(pg, rec) { | 358 | do_for_each_ftrace_rec(pg, rec) { |
359 | if ((rec->ip >= s) && (rec->ip < e)) | 359 | if ((rec->ip >= s) && (rec->ip < e) && |
360 | !(rec->flags & FTRACE_FL_FREE)) | ||
360 | ftrace_free_rec(rec); | 361 | ftrace_free_rec(rec); |
361 | } while_for_each_ftrace_rec(); | 362 | } while_for_each_ftrace_rec(); |
362 | mutex_unlock(&ftrace_lock); | 363 | mutex_unlock(&ftrace_lock); |