From 97a171e11f8fcec6ee66c6c7cc33665f3c1c9a88 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 21 Jul 2020 12:51:48 -0400 Subject: [PATCH] Fix: sessiond: wrong variable checked for error code MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Coverity reports: 1430513 Logically dead code The indicated dead code may have performed some action; that action will never occur. In ust_app_open_packets: Code can never be reached because of a logical contradiction (CWE-561) The `open_ret` variable should be checked instead of `ret` after calling consumer_open_channel_packets. Signed-off-by: Jérémie Galarneau Change-Id: I49ad2d2b747e29414fee7f0727df1feb343695bb --- src/bin/lttng-sessiond/ust-app.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index befbfab32..58be25bbd 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -6747,7 +6747,7 @@ enum lttng_error_code ust_app_open_packets(struct ltt_session *session) * Per-PID buffer and application going * away. */ - if (ret == -LTTNG_ERR_CHAN_NOT_FOUND) { + if (open_ret == -LTTNG_ERR_CHAN_NOT_FOUND) { continue; } -- 2.34.1