From: Zhaolei Date: Fri, 13 Mar 2009 09:14:01 +0000 (+0800) Subject: ftrace: avoid double-free of dyn_ftrace X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=b00f0b6dc1773b4c8f538503247da050b5ea631b;p=linux-2.6-omap-h63xx.git 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 Cc: "Steven Rostedt ;" LKML-Reference: <49BA23D9.1050900@cn.fujitsu.com> Signed-off-by: Ingo Molnar --- diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index d33d306bdcf..26c45aaf680 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -356,7 +356,8 @@ void ftrace_release(void *start, unsigned long size) mutex_lock(&ftrace_lock); do_for_each_ftrace_rec(pg, rec) { - if ((rec->ip >= s) && (rec->ip < e)) + if ((rec->ip >= s) && (rec->ip < e) && + !(rec->flags & FTRACE_FL_FREE)) ftrace_free_rec(rec); } while_for_each_ftrace_rec(); mutex_unlock(&ftrace_lock);