From 53bc54cd6a867b0549a14edbef056d466e54e537 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Wed, 26 Jul 2017 16:45:07 -0400 Subject: [PATCH] Fix: cli: Coverity issue: no need to check `status` MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- cli/babeltrace.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/cli/babeltrace.c b/cli/babeltrace.c index 215092fd..8c0c50de 100644 --- a/cli/babeltrace.c +++ b/cli/babeltrace.c @@ -1591,23 +1591,24 @@ int cmd_run_ctx_connect_upstream_port_to_downstream_component( } ctx->connect_ports = true; } - goto end; - } - if (status != BT_GRAPH_STATUS_OK) { - BT_LOGE("Cannot create connection: cannot find a matching downstream port for upstream port: " - "upstream-port-addr=%p, upstream-port-name=\"%s\", " - "downstream-comp-name=\"%s\", conn-arg=\"%s\"", - upstream_port, bt_port_get_name(upstream_port), - cfg_conn->downstream_comp_name->str, - cfg_conn->arg->str); - fprintf(stderr, - "Cannot create connection: cannot find a matching downstream port for upstream port `%s`: %s\n", - bt_port_get_name(upstream_port), cfg_conn->arg->str); - goto error; + /* + * We found a matching downstream port: the search is + * over. + */ + goto end; } - goto end; + /* No downstream port found */ + BT_LOGE("Cannot create connection: cannot find a matching downstream port for upstream port: " + "upstream-port-addr=%p, upstream-port-name=\"%s\", " + "downstream-comp-name=\"%s\", conn-arg=\"%s\"", + upstream_port, bt_port_get_name(upstream_port), + cfg_conn->downstream_comp_name->str, + cfg_conn->arg->str); + fprintf(stderr, + "Cannot create connection: cannot find a matching downstream port for upstream port `%s`: %s\n", + bt_port_get_name(upstream_port), cfg_conn->arg->str); error: ret = -1; -- 2.34.1