Fix: create_kernel_session asserts on failure
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 18 Jan 2019 17:40:47 +0000 (12:40 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 21 Jan 2019 18:39:25 +0000 (13:39 -0500)
create_kernel_session() will call trace_kernel_destroy_session()
on failure to create a kernel session (e.g. modules failed to load).

This can be reproduced by enabling kernel events on a session after
the session daemon has failed to load the LTTng kernel modules.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/client.c

index 67e246b63505bb71819bc273cda7e861d2c7cadb..a889529a76967f881c9c05159ccdb55300336f51 100644 (file)
@@ -475,7 +475,7 @@ static int create_kernel_session(struct ltt_session *session)
        ret = kernel_create_session(session, kernel_tracer_fd);
        if (ret < 0) {
                ret = LTTNG_ERR_KERN_SESS_FAIL;
-               goto error;
+               goto error_create;
        }
 
        /* Code flow safety */
@@ -497,6 +497,7 @@ static int create_kernel_session(struct ltt_session *session)
 error:
        trace_kernel_destroy_session(session->kernel_session);
        session->kernel_session = NULL;
+error_create:
        return ret;
 }
 
This page took 0.026091 seconds and 4 git commands to generate.