Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
if (ret < 0) {
goto error;
}
if (ret < 0) {
goto error;
}
- buffer_reg_pid_add(reg_pid);
app->byte_order, app->version.major,
app->version.minor);
if (ret < 0) {
app->byte_order, app->version.major,
app->version.minor);
if (ret < 0) {
+ /*
+ * reg_pid->registry->reg.ust is NULL upon error, so we need to
+ * destroy the buffer registry, because it is always expected
+ * that if the buffer registry can be found, its ust registry is
+ * non-NULL.
+ */
+ buffer_reg_pid_destroy(reg_pid);
+ buffer_reg_pid_add(reg_pid);
+
DBG3("UST app buffer registry per PID created successfully");
end:
DBG3("UST app buffer registry per PID created successfully");
end:
if (ret < 0) {
goto error;
}
if (ret < 0) {
goto error;
}
- buffer_reg_uid_add(reg_uid);
app->byte_order, app->version.major,
app->version.minor);
if (ret < 0) {
app->byte_order, app->version.major,
app->version.minor);
if (ret < 0) {
+ /*
+ * reg_uid->registry->reg.ust is NULL upon error, so we need to
+ * destroy the buffer registry, because it is always expected
+ * that if the buffer registry can be found, its ust registry is
+ * non-NULL.
+ */
+ buffer_reg_uid_destroy(reg_uid, NULL);
goto error;
}
/* Add node to teardown list of the session. */
cds_list_add(®_uid->lnode, &usess->buffer_reg_uid_list);
goto error;
}
/* Add node to teardown list of the session. */
cds_list_add(®_uid->lnode, &usess->buffer_reg_uid_list);
- DBG3("UST app buffer registry per UID created successfully");
+ buffer_reg_uid_add(reg_uid);
+ DBG3("UST app buffer registry per UID created successfully");
end:
if (regp) {
*regp = reg_uid;
end:
if (regp) {
*regp = reg_uid;
struct lttng_ht_iter iter;
struct ust_registry_channel *chan;
struct lttng_ht_iter iter;
struct ust_registry_channel *chan;
+ if (!reg) {
+ return;
+ }
/* On error, EBUSY can be returned if lock. Code flow error. */
ret = pthread_mutex_destroy(®->lock);
/* On error, EBUSY can be returned if lock. Code flow error. */
ret = pthread_mutex_destroy(®->lock);