From 4dc3dfc55223dae057447c03a1e7aadc2c177b3a Mon Sep 17 00:00:00 2001 From: David Goulet Date: Tue, 30 Apr 2013 15:32:31 -0400 Subject: [PATCH] Fix: change order of fd get to fix error path Last commit had a wrong error path that could lead to an unbalanced fd put/get. Signed-off-by: David Goulet --- src/bin/lttng-sessiond/ust-app.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index d40593998..e36238182 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -2537,13 +2537,6 @@ static int create_ust_app_metadata(struct ust_app_session *ua_sess, 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) { @@ -2551,6 +2544,13 @@ static int create_ust_app_metadata(struct ust_app_session *ua_sess, 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 -- 2.34.1