Skip to content

Commit

Permalink
tracing: Fix failure path in ftrace_regex_open()
Browse files Browse the repository at this point in the history
Don't forget to free trace_parser if seq_open() returned failure.

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: <4AB86694.4040803@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Li Zefan authored and Ingo Molnar committed Sep 22, 2009
1 parent 1eb90f1 commit 79fe249
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1621,8 +1621,10 @@ ftrace_regex_open(struct inode *inode, struct file *file, int enable)
if (!ret) {
struct seq_file *m = file->private_data;
m->private = iter;
} else
} else {
trace_parser_put(&iter->parser);
kfree(iter);
}
} else
file->private_data = iter;
mutex_unlock(&ftrace_regex_lock);
Expand Down

0 comments on commit 79fe249

Please sign in to comment.