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>
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);
}
}
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);
}
}