Commit 79fe249c authored by Li Zefan's avatar Li Zefan Committed by Ingo Molnar

tracing: Fix failure path in ftrace_regex_open()

Don't forget to free trace_parser if seq_open() returned failure.
Signed-off-by: default avatarLi 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: default avatarIngo Molnar <mingo@elte.hu>
parent 1eb90f13
...@@ -1621,8 +1621,10 @@ ftrace_regex_open(struct inode *inode, struct file *file, int enable) ...@@ -1621,8 +1621,10 @@ ftrace_regex_open(struct inode *inode, struct file *file, int enable)
if (!ret) { if (!ret) {
struct seq_file *m = file->private_data; struct seq_file *m = file->private_data;
m->private = iter; m->private = iter;
} else } else {
trace_parser_put(&iter->parser);
kfree(iter); kfree(iter);
}
} else } else
file->private_data = iter; file->private_data = iter;
mutex_unlock(&ftrace_regex_lock); mutex_unlock(&ftrace_regex_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment