Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: yjwei@cn.fujitsu.com (Wei Yongjun)
Subject: [ltt-dev] lttng: Fix possible memory leak in ltt-tracer.c
Date: Tue, 21 Oct 2008 16:19:41 +0800	[thread overview]
Message-ID: <48FD909D.2000906@cn.fujitsu.com> (raw)

ltt_traces <../cgi-bin/global.cgi?pattern=ltt_traces&type=symbol>.head 
<../cgi-bin/global.cgi?pattern=head&type=symbol> is saved to tmp, and is 
empty after the following code:
    INIT_LIST_HEAD(&ltt_traces.head);
So remove the tracers will take no effect.

This patch fix to remove tracers used tmp.

Signed-off-by: Wei Yongjun <yjwei at cn.fujitsu.com>

diff --git a/ltt/ltt-tracer.c b/ltt/ltt-tracer.c
index bc8251b..6109fb6 100644
--- a/ltt/ltt-tracer.c
+++ b/ltt/ltt-tracer.c
@@ -818,7 +818,7 @@ static void __exit ltt_exit(void)
 	synchronize_sched();
 	/* Safe iteration is now permitted. It does not have to be RCU-safe
 	 * because no readers are left. */
-	list_for_each_safe(pos, n, &ltt_traces.head) {
+	list_for_each_safe(pos, n, &tmp) {
 		trace = container_of(pos, struct ltt_trace_struct, list);
 		/* _ltt_trace_destroy does a synchronize_sched() */
 		_ltt_trace_destroy(trace);





             reply	other threads:[~2008-10-21  8:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-21  8:19 Wei Yongjun [this message]
2008-10-21 14:11 ` Mathieu Desnoyers

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=48FD909D.2000906@cn.fujitsu.com \
    --to=yjwei@cn.fujitsu.com \
    /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