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.11.5~16 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=225687bb334e23bdde1061106e4a0d78e7c71d03;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 da5d7ccfb..11c43046c 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 = {};