Fix: improve error handling for UST stream creation
authorDavid Goulet <dgoulet@efficios.com>
Mon, 21 Jan 2013 15:50:44 +0000 (10:50 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Mon, 21 Jan 2013 16:00:51 +0000 (11:00 -0500)
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/ust-app.c

index 6430c83f705494749c5b64a33305be1569e6e551..85f705542776215e2ea53f6b3bd00a0a9e8d0929 100644 (file)
@@ -2288,11 +2288,16 @@ int ust_app_start_trace(struct ltt_ust_session *usess, struct ust_app *app)
                        ret = ustctl_create_stream(app->sock, ua_chan->obj,
                                        &ustream->obj);
                        if (ret < 0) {
-                               /* Got all streams */
-                               lttng_fd_put(LTTNG_FD_APPS, 2);
+                               /* Free unused memory and reset FD states. */
                                free(ustream);
+                               lttng_fd_put(LTTNG_FD_APPS, 2);
+                               if (ret == -ENOENT) {
+                                       /* Got all streams. Continue normal execution. */
+                                       break;
+                               }
+                               /* Error at this point. Stop everything. */
                                ret = LTTNG_ERR_UST_STREAM_FAIL;
-                               break;
+                               goto error_rcu_unlock;
                        }
                        ustream->handle = ustream->obj->handle;
 
This page took 0.028037 seconds and 4 git commands to generate.