Fix: ret may be used uninitialized in sample_channel_positions()
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Mon, 30 Apr 2018 18:27:35 +0000 (14:27 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 9 May 2018 19:10:21 +0000 (15:10 -0400)
sample_channel_positions() returns garbage if
cds_lfht_is_node_deleted(&stream->node.node) on first and "possibly"
only iteration of the consumer_data.stream_per_chan_id_ht hash table.

Found by scan-build.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/consumer/consumer-timer.c

index e42940ed991fa60a6ec7e0e744ebd1033e203bf9..557d96b2935c4c8abbe43f9246e11fc4969b01f2 100644 (file)
@@ -637,7 +637,7 @@ int sample_channel_positions(struct lttng_consumer_channel *channel,
                sample_positions_cb sample, get_consumed_cb get_consumed,
                get_produced_cb get_produced)
 {
-       int ret;
+       int ret = 0;
        struct lttng_ht_iter iter;
        struct lttng_consumer_stream *stream;
        bool empty_channel = true;
This page took 0.025045 seconds and 4 git commands to generate.