Fix: Tests: test_session.c: Structurally dead code
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Tue, 1 Oct 2019 15:50:43 +0000 (11:50 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 3 Oct 2019 01:48:47 +0000 (21:48 -0400)
Coverity report:
  CID 1400680 (#1 of 1): Structurally dead code (UNREACHABLE)
  unreachable: This code cannot be reached: ret = 0;.

Reported-by: Coverity (1400680) Structurally dead code
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/unit/test_session.c

index c7ad4ec71be3d70b87100be069bab9c328d1c445..b538bddc6bac261ca2a6615d065ebcce11b71126 100644 (file)
@@ -141,21 +141,17 @@ static int create_one_session(char *name)
                        /* Session not found by name */
                        printf("session not found after creation\n");
                        ret = -1;
-                       goto end;
                } else {
                        /* Success */
                        ret = 0;
-                       goto end;
                }
        } else {
                if (ret_code == LTTNG_ERR_EXIST_SESS) {
                        printf("(session already exists) ");
                }
                ret = -1;
-               goto end;
        }
-       ret = 0;
-end:
+
        session_unlock_list();
        return ret;
 }
This page took 0.027095 seconds and 4 git commands to generate.