From 3517bb6841bfddf35ef13f173055c53fad5fc16a Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Tue, 1 Oct 2019 11:50:43 -0400 Subject: [PATCH] Fix: Tests: test_session.c: Structurally dead code MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- tests/unit/test_session.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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; } -- 2.34.1