From 3c14c33fe61a2011881075506e6946ca5cdf23c1 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Mon, 5 Nov 2012 17:03:19 -0500 Subject: [PATCH] Fix: Channel creation error return code was not set Signed-off-by: David Goulet --- src/bin/lttng-sessiond/ust-app.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index e0562ed4e..4cae85d6e 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -1983,6 +1983,7 @@ int ust_app_disable_all_event_glb(struct ltt_ust_session *usess, int ust_app_create_channel_glb(struct ltt_ust_session *usess, struct ltt_ust_channel *uchan) { + int ret = 0; struct lttng_ht_iter iter; struct ust_app *app; struct ust_app_session *ua_sess; @@ -2014,9 +2015,11 @@ int ust_app_create_channel_glb(struct ltt_ust_session *usess, ua_sess = create_ust_app_session(usess, app); if (ua_sess == NULL) { /* The malloc() failed. */ + ret = -1; goto error; } else if (ua_sess == (void *) -1UL) { /* The application's socket is not valid. Contiuing */ + ret = -1; continue; } @@ -2024,16 +2027,15 @@ int ust_app_create_channel_glb(struct ltt_ust_session *usess, ua_chan = create_ust_app_channel(ua_sess, uchan, app); if (ua_chan == NULL) { /* Major problem here and it's maybe the tracer or malloc() */ + ret = -1; goto error; } } rcu_read_unlock(); - return 0; - error: - return -1; + return ret; } /* -- 2.34.1