From: Francis Deslauriers Date: Tue, 1 Oct 2019 15:50:43 +0000 (-0400) Subject: Fix: Tests: test_session.c: Structurally dead code X-Git-Tag: v2.12.0-rc1~337 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=3517bb6841bfddf35ef13f173055c53fad5fc16a;p=lttng-tools.git Fix: Tests: test_session.c: Structurally dead code 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 Signed-off-by: Jérémie Galarneau --- diff --git a/tests/unit/test_session.c b/tests/unit/test_session.c index c7ad4ec71..b538bddc6 100644 --- a/tests/unit/test_session.c +++ b/tests/unit/test_session.c @@ -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; }