Fix: Channel creation error return code was not set
authorDavid Goulet <dgoulet@efficios.com>
Mon, 5 Nov 2012 22:03:19 +0000 (17:03 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Mon, 5 Nov 2012 22:31:23 +0000 (17:31 -0500)
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/ust-app.c

index e0562ed4e5448d2e184b288481fad0e80bb77b0b..4cae85d6e75719c4c1db5ca26c3627b2bdd2c803 100644 (file)
@@ -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;
 }
 
 /*
This page took 0.027885 seconds and 4 git commands to generate.