From 78fc586baa98ae77506c34eac8bb980a7d3cc901 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 11 Sep 2019 13:22:32 -0400 Subject: [PATCH] sessiond: clean-up: init ret value of _session_set_trace_chunk_no_lock_check MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This fixes are warning that 'ret' may not be initialized when a session has no ust nor kernel session. In such a case, the sessiond would never start a session and thus would not assign a trace chunk to the session. Still, this can be confuging so it is better-off being fixed. Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/session.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/lttng-sessiond/session.c b/src/bin/lttng-sessiond/session.c index 2e39c4317..9072a2ecb 100644 --- a/src/bin/lttng-sessiond/session.c +++ b/src/bin/lttng-sessiond/session.c @@ -423,7 +423,7 @@ int _session_set_trace_chunk_no_lock_check(struct ltt_session *session, struct lttng_trace_chunk *new_trace_chunk, struct lttng_trace_chunk **_current_trace_chunk) { - int ret; + int ret = 0; unsigned int i, refs_to_acquire = 0, refs_acquired = 0, refs_to_release = 0; struct cds_lfht_iter iter; struct consumer_socket *socket; -- 2.34.1