Fix: cli: Coverity issue: no need to check `status`
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 26 Jul 2017 20:45:07 +0000 (16:45 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 11 Aug 2017 22:54:15 +0000 (18:54 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
cli/babeltrace.c

index 215092fd0ceb58e0760bd9c3285de3171ee21144..8c0c50de54b1c65f5a5d29c6812255374d755c64 100644 (file)
@@ -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;
This page took 0.027173 seconds and 4 git commands to generate.