From: Jérémie Galarneau Date: Fri, 18 Jan 2019 17:40:47 +0000 (-0500) Subject: Fix: create_kernel_session asserts on failure X-Git-Tag: v2.12.0-rc1~664 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5d0a7bcb4407e434e2278ce3a7be2c30d00c3313;p=lttng-tools.git Fix: create_kernel_session asserts on failure 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 --- diff --git a/src/bin/lttng-sessiond/client.c b/src/bin/lttng-sessiond/client.c index 67e246b63..a889529a7 100644 --- a/src/bin/lttng-sessiond/client.c +++ b/src/bin/lttng-sessiond/client.c @@ -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; }