From: Jérémie Galarneau Date: Fri, 5 May 2017 17:36:30 +0000 (-0400) Subject: Tests fix: initialize kernel extended channel attributes X-Git-Tag: v2.10.0-rc1~14 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=63aaa3dcfd221ac2bcdbc6b61d5e3fbaeca70165;p=lttng-tools.git Tests fix: initialize kernel extended channel attributes Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/trace-kernel.c b/src/bin/lttng-sessiond/trace-kernel.c index d6ee8e8af..876fda5bb 100644 --- a/src/bin/lttng-sessiond/trace-kernel.c +++ b/src/bin/lttng-sessiond/trace-kernel.c @@ -522,10 +522,12 @@ void trace_kernel_destroy_channel(struct ltt_kernel_channel *channel) /* Remove from channel list */ cds_list_del(&channel->list); - status = notification_thread_command_remove_channel( - notification_thread_handle, - channel->fd, LTTNG_DOMAIN_KERNEL); - assert(status == LTTNG_OK); + if (notification_thread_handle) { + status = notification_thread_command_remove_channel( + notification_thread_handle, + channel->fd, LTTNG_DOMAIN_KERNEL); + assert(status == LTTNG_OK); + } free(channel->channel->attr.extended.ptr); free(channel->channel); free(channel); diff --git a/tests/unit/test_kernel_data.c b/tests/unit/test_kernel_data.c index ad4666b6f..ff1b75df4 100644 --- a/tests/unit/test_kernel_data.c +++ b/tests/unit/test_kernel_data.c @@ -116,8 +116,11 @@ static void test_create_kernel_channel(void) { struct ltt_kernel_channel *chan; struct lttng_channel attr; + struct lttng_channel_extended extended; memset(&attr, 0, sizeof(attr)); + memset(&extended, 0, sizeof(extended)); + attr.attr.extended.ptr = &extended; chan = trace_kernel_create_channel(&attr); ok(chan != NULL, "Create kernel channel");