From: Jérémie Galarneau Date: Tue, 21 Jul 2020 16:51:48 +0000 (-0400) Subject: Fix: sessiond: wrong variable checked for error code X-Git-Tag: v2.13.0-rc1~589 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=97a171e11f8fcec6ee66c6c7cc33665f3c1c9a88;p=lttng-tools.git Fix: sessiond: wrong variable checked for error code 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 --- 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; }