From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
Li Zefan <lizf@cn.fujitsu.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH 1/3] trace_stack: Fix seqfile memory leak
Date: Thu, 23 Jul 2009 10:03:00 -0400 [thread overview]
Message-ID: <20090723140514.198935904@goodmis.org> (raw)
In-Reply-To: 20090723140259.100790900@goodmis.org
[-- Attachment #1: 0001-trace_stack-Fix-seqfile-memory-leak.patch --]
[-- Type: text/plain, Size: 989 bytes --]
From: Li Zefan <lizf@cn.fujitsu.com>
Every time we cat stack_trace, we leak memory allocated by seq_open().
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <4A67D8E8.3020500@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/trace/trace_stack.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c
index e644af9..6a2a9d4 100644
--- a/kernel/trace/trace_stack.c
+++ b/kernel/trace/trace_stack.c
@@ -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
--
1.6.3.3
--
next prev parent reply other threads:[~2009-07-23 14:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-23 14:02 [GIT PULL][2.6.31] tracing: fix of memory leaks Steven Rostedt
2009-07-23 14:03 ` Steven Rostedt [this message]
2009-07-23 14:03 ` [PATCH 2/3] function-graph: Fix seqfile memory leak Steven Rostedt
2009-07-23 14:03 ` [PATCH 3/3] tracing/stat: " Steven Rostedt
-- strict thread matches above, loose matches on Subject: below --
2009-07-23 3:28 [PATCH 0/3] tracing: Fix seqfile memory leak for .31 Li Zefan
2009-07-23 3:28 ` [PATCH 1/3] trace_stack: Fix seqfile memory leak Li Zefan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090723140514.198935904@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox