From: Jonathan Rajotte Date: Mon, 30 Apr 2018 18:27:35 +0000 (-0400) Subject: Fix: ret may be used uninitialized in sample_channel_positions() X-Git-Tag: v2.11.0-rc1~256 X-Git-Url: https://git.liburcu.org/?a=commitdiff_plain;h=23bc9bb5ee7a2f637d68341ba425700e04ea101f;p=lttng-tools.git Fix: ret may be used uninitialized in sample_channel_positions() 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 Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/consumer/consumer-timer.c b/src/common/consumer/consumer-timer.c index 721f146e2..38b8b30d2 100644 --- a/src/common/consumer/consumer-timer.c +++ b/src/common/consumer/consumer-timer.c @@ -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;