diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2009-09-22 13:52:57 +0800 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-09-22 10:28:56 +0200 |
commit | 1eb90f138b3fb4cc15f3acec94aa788e846269f7 (patch) | |
tree | d5e361214065598094d9b4ec71b3591edeaa74e5 /kernel/trace | |
parent | 4ba7978e98a3ff92cebfb0f31a02c309e3ffa1fe (diff) | |
download | op-kernel-dev-1eb90f138b3fb4cc15f3acec94aa788e846269f7.zip op-kernel-dev-1eb90f138b3fb4cc15f3acec94aa788e846269f7.tar.gz |
tracing: Fix failure path in ftrace_graph_write()
Don't call trace_parser_put() on uninitialized trace_parser.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <4AB86639.3000003@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/ftrace.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index a8fe478..5c5cb9b 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -2561,12 +2561,12 @@ ftrace_graph_write(struct file *file, const char __user *ubuf, if (ftrace_graph_count >= FTRACE_GRAPH_MAX_FUNCS) { ret = -EBUSY; - goto out; + goto out_unlock; } if (trace_parser_get_init(&parser, FTRACE_BUFF_MAX)) { ret = -ENOMEM; - goto out; + goto out_unlock; } read = trace_get_user(&parser, ubuf, cnt, ppos); @@ -2578,12 +2578,14 @@ ftrace_graph_write(struct file *file, const char __user *ubuf, ret = ftrace_set_func(ftrace_graph_funcs, &ftrace_graph_count, parser.buffer); if (ret) - goto out; + goto out_free; } ret = read; - out: + +out_free: trace_parser_put(&parser); +out_unlock: mutex_unlock(&graph_lock); return ret; |