All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH lttng-tools] Initialize ret to zero
@ 2018-04-30 18:27 Jonathan Rajotte
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Rajotte @ 2018-04-30 18:27 UTC (permalink / raw)
  To: lttng-dev; +Cc: jgalar

sample_channel_positions return 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>
---
 src/common/consumer/consumer-timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/consumer/consumer-timer.c b/src/common/consumer/consumer-timer.c
index 721f146e..38b8b30d 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;
-- 
2.17.0

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-02 14:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20180430182735.12118-1-jonathan.rajotte-julien@efficios.com>
2018-05-02 14:25 ` [PATCH lttng-tools] Initialize ret to zero Jérémie Galarneau
2018-04-30 18:27 Jonathan Rajotte

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.