From: Jérémie Galarneau Date: Wed, 17 Jun 2020 23:13:50 +0000 (-0400) Subject: Fix: consumerd: uninitialized written_bytes on no-data sleep X-Git-Tag: v2.12.2~27 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=9a63f11d79d1d5ad06b2def005d54c93e8c523aa;p=lttng-tools.git Fix: consumerd: uninitialized written_bytes on no-data sleep e66d26f51 introduces a jump to a label which causes `written_bytes` (the return value) to not be initialized. written_bytes may be used uninitialized in this function [-Wmaybe-uninitialized] Signed-off-by: Jérémie Galarneau Change-Id: I72c5c07298093f27fa72b72cb157ce4eedb81adb --- diff --git a/src/common/consumer/consumer.c b/src/common/consumer/consumer.c index 91725d5d4..99514280a 100644 --- a/src/common/consumer/consumer.c +++ b/src/common/consumer/consumer.c @@ -3314,7 +3314,7 @@ ssize_t lttng_consumer_read_subbuffer(struct lttng_consumer_stream *stream, struct lttng_consumer_local_data *ctx, bool locked_by_caller) { - ssize_t ret, written_bytes; + ssize_t ret, written_bytes = 0; int rotation_ret; struct stream_subbuffer subbuffer = {};