Fix disabled channel timer start/stop handling v0.19.9
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 19 Apr 2011 02:09:46 +0000 (22:09 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 19 Apr 2011 02:09:46 +0000 (22:09 -0400)
Should test if channels are active before calling timer start/stop,
otherwise causes NULL pointer exception.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
ltt-tracer.c

index 24a3a92e853938b7e10e9ee643b0412698ee0b2b..1ca5ba2b5f7c4e04132eb40f47f4d9191bcb6079 100644 (file)
@@ -1031,7 +1031,9 @@ void ltt_channels_trace_start_timer(struct ltt_chan *channels,
 
        for (i = 0; i < nr_channels; i++) {
                struct ltt_chan *chan = &channels[i];
-               chan->a.trace->ops->start_switch_timer(chan);
+
+               if (chan->active)
+                       chan->a.trace->ops->start_switch_timer(chan);
        }
 }
 
@@ -1046,7 +1048,9 @@ void ltt_channels_trace_stop_timer(struct ltt_chan *channels,
 
        for (i = 0; i < nr_channels; i++) {
                struct ltt_chan *chan = &channels[i];
-               chan->a.trace->ops->stop_switch_timer(chan);
+
+               if (chan->active)
+                       chan->a.trace->ops->stop_switch_timer(chan);
        }
 }
 
This page took 0.02684 seconds and 4 git commands to generate.