Skip to content

Commit

Permalink
trace_stack: Fix seqfile memory leak
Browse files Browse the repository at this point in the history
Every time we cat stack_trace, we leak memory allocated by seq_open().

Signed-off-by: Li Zefan <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
  • Loading branch information
Li Zefan authored and rostedt committed Jul 23, 2009
1 parent e5d490b commit d8cc1ab
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions kernel/trace/trace_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,17 +301,14 @@ static const struct seq_operations stack_trace_seq_ops = {

static int stack_trace_open(struct inode *inode, struct file *file)
{
int ret;

ret = seq_open(file, &stack_trace_seq_ops);

return ret;
return seq_open(file, &stack_trace_seq_ops);
}

static const struct file_operations stack_trace_fops = {
.open = stack_trace_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
};

int
Expand Down

0 comments on commit d8cc1ab

Please sign in to comment.