From: Mathieu Desnoyers Date: Tue, 19 Apr 2011 02:09:46 +0000 (-0400) Subject: Fix disabled channel timer start/stop handling X-Git-Tag: v0.19.9 X-Git-Url: https://git.lttng.org/?p=lttng-modules.git;a=commitdiff_plain;h=e5b34c668a7d7b8aeab9fa2bdbb31eed4eff7929 Fix disabled channel timer start/stop handling Should test if channels are active before calling timer start/stop, otherwise causes NULL pointer exception. Signed-off-by: Mathieu Desnoyers --- diff --git a/ltt-tracer.c b/ltt-tracer.c index 24a3a92e..1ca5ba2b 100644 --- a/ltt-tracer.c +++ b/ltt-tracer.c @@ -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); } }