Commit d8cc1ab7 authored by Li Zefan's avatar Li Zefan Committed by Steven Rostedt

trace_stack: Fix seqfile memory leak

Every time we cat stack_trace, we leak memory allocated by seq_open().
Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <4A67D8E8.3020500@cn.fujitsu.com>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent e5d490b2
...@@ -301,17 +301,14 @@ static const struct seq_operations stack_trace_seq_ops = { ...@@ -301,17 +301,14 @@ static const struct seq_operations stack_trace_seq_ops = {
static int stack_trace_open(struct inode *inode, struct file *file) static int stack_trace_open(struct inode *inode, struct file *file)
{ {
int ret; return seq_open(file, &stack_trace_seq_ops);
ret = seq_open(file, &stack_trace_seq_ops);
return ret;
} }
static const struct file_operations stack_trace_fops = { static const struct file_operations stack_trace_fops = {
.open = stack_trace_open, .open = stack_trace_open,
.read = seq_read, .read = seq_read,
.llseek = seq_lseek, .llseek = seq_lseek,
.release = seq_release,
}; };
int int
......
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