X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=liblttng-ust%2Flttng-ust-abi.c;h=af2a47dcb5269ac8ec478a75fa18afdfd63fbd2a;hb=8a36ff81a49e70d53e56942ea7d5db4f49b185f0;hp=9c4ddf15517a9c7a7a4b107574d173b87eedca96;hpb=e7bc0ef6c86ae97886cf5f8b28854cf281d4962b;p=lttng-ust.git diff --git a/liblttng-ust/lttng-ust-abi.c b/liblttng-ust/lttng-ust-abi.c index 9c4ddf15..af2a47dc 100644 --- a/liblttng-ust/lttng-ust-abi.c +++ b/liblttng-ust/lttng-ust-abi.c @@ -502,6 +502,11 @@ int lttng_abi_map_channel(int session_objd, goto alloc_error; } + if (lttng_ust_session_uuid_validate(session, lttng_chan_config->uuid)) { + ret = -EINVAL; + goto uuid_error; + } + /* Lookup transport name */ switch (type) { case LTTNG_UST_ABI_CHAN_PER_CPU: @@ -548,8 +553,8 @@ int lttng_abi_map_channel(int session_objd, lttng_chan_buf->parent->session = session; lttng_chan_buf->priv->parent.tstate = 1; + lttng_chan_buf->priv->ctx = NULL; - lttng_chan_buf->ctx = NULL; lttng_chan_buf->ops = &transport->ops; lttng_chan_buf->chan = chan; lttng_chan_buf->handle = channel_handle; @@ -578,6 +583,7 @@ int lttng_abi_map_channel(int session_objd, /* error path after channel was created */ objd_error: notransport: +uuid_error: alloc_error: channel_destroy(chan, channel_handle, 0); lttng_ust_free_channel_common(lttng_chan_buf->parent); @@ -1238,7 +1244,7 @@ long lttng_channel_cmd(int objd, unsigned int cmd, unsigned long arg, case LTTNG_UST_ABI_CONTEXT: return lttng_abi_add_context(objd, (struct lttng_ust_abi_context *) arg, uargs, - <tng_chan_buf->ctx, + <tng_chan_buf->priv->ctx, lttng_chan_buf->parent->session); case LTTNG_UST_ABI_ENABLE: return lttng_channel_enable(lttng_chan_buf->parent);