Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [ltt-dev] lttng: Fix possible memory leak in ltt-tracer.c
@ 2008-10-21  8:19 Wei Yongjun
  2008-10-21 14:11 ` Mathieu Desnoyers
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2008-10-21  8:19 UTC (permalink / 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);





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ltt-dev] lttng: Fix possible memory leak in ltt-tracer.c
  2008-10-21  8:19 [ltt-dev] lttng: Fix possible memory leak in ltt-tracer.c Wei Yongjun
@ 2008-10-21 14:11 ` Mathieu Desnoyers
  0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Desnoyers @ 2008-10-21 14:11 UTC (permalink / raw)


* Wei Yongjun (yjwei at cn.fujitsu.com) wrote:
> 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>
>
Yep, good catch. Thanks !

Acked-by: Mathieu Desnoyers <mathieu.desnoyers at polymtl.ca>

> 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);
>
>
>
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
>

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-10-21 14:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-21  8:19 [ltt-dev] lttng: Fix possible memory leak in ltt-tracer.c Wei Yongjun
2008-10-21 14:11 ` Mathieu Desnoyers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox