X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-app.c;h=675283aa63477b3679aa27a7f8942d1c52453dae;hb=9acdc1d6905e2bf2c814d303b152e56525745710;hp=eb0f837160edf5b533bbc822ef0e8ddd768962f4;hpb=491d15395b58df09f8a3e7ba7404eb1f46392b79;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index eb0f83716..675283aa6 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -2365,7 +2365,7 @@ int create_ust_app_channel_context(struct ust_app_session *ua_sess, ua_ctx = alloc_ust_app_ctx(uctx); if (ua_ctx == NULL) { /* malloc failed */ - ret = -1; + ret = -ENOMEM; goto error; } @@ -2845,6 +2845,8 @@ error: /* * Create and send to the application the created buffers with per UID buffers. * + * This MUST be called with a RCU read side lock acquired. + * * Return 0 on success else a negative value. */ static int create_channel_per_uid(struct ust_app *app, @@ -2917,15 +2919,6 @@ static int create_channel_per_uid(struct ust_app *app, created = true; } - /* Send buffers to the application. */ - ret = send_channel_uid_to_ust(reg_chan, app, ua_sess, ua_chan); - if (ret < 0) { - if (ret != -ENOTCONN) { - ERR("Error sending channel to application"); - } - goto error; - } - if (created) { enum lttng_error_code cmd_ret; struct ltt_session *session; @@ -2961,6 +2954,15 @@ static int create_channel_per_uid(struct ust_app *app, } } + /* Send buffers to the application. */ + ret = send_channel_uid_to_ust(reg_chan, app, ua_sess, ua_chan); + if (ret < 0) { + if (ret != -ENOTCONN) { + ERR("Error sending channel to application"); + } + goto error; + } + error: return ret; }