Fix: add missing buffer registry cleanup on error
authorDavid Goulet <dgoulet@efficios.com>
Tue, 28 May 2013 21:58:44 +0000 (17:58 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Wed, 29 May 2013 16:17:44 +0000 (12:17 -0400)
Fixes #542

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/buffer-registry.c
src/bin/lttng-sessiond/ust-app.c

index 2df98d7360445b42ae4aba1941cd976d16e6d723..6a35284fe70eab9435052a86874537d2936b40f7 100644 (file)
@@ -492,8 +492,7 @@ void buffer_reg_channel_destroy(struct buffer_reg_channel *regp,
                return;
        }
 
-       DBG3("Buffer registry channel destroy with key %" PRIu32 " and handle %d",
-                       regp->key, regp->obj.ust->handle);
+       DBG3("Buffer registry channel destroy with key %" PRIu32, regp->key);
 
        switch (domain) {
        case LTTNG_DOMAIN_UST:
index dfc4599be858315b3a2b25956b0daa49e9d24bd2..4fb23b627921ed2266ab9d885dd94993ffa9133e 100644 (file)
@@ -2246,6 +2246,14 @@ static int create_channel_per_uid(struct ust_app *app,
                ret = do_consumer_create_channel(usess, ua_sess, ua_chan,
                                app->bits_per_long, reg_uid->registry->reg.ust);
                if (ret < 0) {
+                       /*
+                        * Let's remove the previously created buffer registry channel so
+                        * it's not visible anymore in the session registry.
+                        */
+                       ust_registry_channel_del_free(reg_uid->registry->reg.ust,
+                                       ua_chan->tracing_channel_id);
+                       buffer_reg_channel_remove(reg_uid->registry, reg_chan);
+                       buffer_reg_channel_destroy(reg_chan, LTTNG_DOMAIN_UST);
                        goto error;
                }
 
This page took 0.028408 seconds and 4 git commands to generate.