channel = trace_ust_channel_to_lttng_channel(uchan);
if (!channel) {
- ret = LTTNG_ERR_NOMEM;
- break;
+ ret_code = LTTNG_ERR_NOMEM;
+ goto end;
}
extended = (struct lttng_channel_extended *)
if (ret < 0) {
lttng_channel_destroy(channel);
ret_code = LTTNG_ERR_UNK;
- break;
+ goto end;
}
extended->discarded_events = discarded_events;
ret = lttng_channel_serialize(
channel, &payload->buffer);
- lttng_channel_destroy(channel);
if (ret) {
ERR("Failed to serialize lttng_channel: channel name = '%s'",
channel->name);
+ lttng_channel_destroy(channel);
ret_code = LTTNG_ERR_UNK;
- ret = -1;
- break;
+ goto end;
}
+ lttng_channel_destroy(channel);
i++;
}
rcu_read_unlock();