From 3a040d366f457b5d3150ef751ed71ca2aae7fdf8 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Mon, 21 Jan 2013 10:50:44 -0500 Subject: [PATCH] Fix: improve error handling for UST stream creation Signed-off-by: David Goulet --- src/bin/lttng-sessiond/ust-app.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 6430c83f7..85f705542 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -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; -- 2.34.1