Fix: sessiond: wrong variable checked for error code
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 21 Jul 2020 16:51:48 +0000 (12:51 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 21 Jul 2020 17:01:41 +0000 (13:01 -0400)
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 <jeremie.galarneau@efficios.com>
Change-Id: I49ad2d2b747e29414fee7f0727df1feb343695bb

src/bin/lttng-sessiond/ust-app.c

index befbfab32dc2c692b56ef3005e4e46ad0ef9bf2a..58be25bbd20ff27ded6538aa9bfe329f8fbca6ec 100644 (file)
@@ -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;
                                        }
 
This page took 0.028372 seconds and 4 git commands to generate.