Last commit had a wrong error path that could lead to an unbalanced fd
put/get.
Signed-off-by: David Goulet <dgoulet@efficios.com>
metadata->attr.type = LTTNG_UST_CHAN_METADATA;
}
- /* Get the right consumer socket for the application. */
- socket = consumer_find_socket_by_bitness(app->bits_per_long, consumer);
- if (!socket) {
- ret = -EINVAL;
- goto error_consumer;
- }
-
/* Need one fd for the channel. */
ret = lttng_fd_get(LTTNG_FD_APPS, 1);
if (ret < 0) {
goto error;
}
+ /* Get the right consumer socket for the application. */
+ socket = consumer_find_socket_by_bitness(app->bits_per_long, consumer);
+ if (!socket) {
+ ret = -EINVAL;
+ goto error_consumer;
+ }
+
/*
* Keep metadata key so we can identify it on the consumer side. Assign it
* to the registry *before* we ask the consumer so we avoid the race of the