From 8ae38be72fa4066f3d64035ef41435ab2a24cc48 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sun, 13 Nov 2011 12:28:43 -0500 Subject: [PATCH] add_ustctx_all_channels: Move rcu_read_unlock in error label Signed-off-by: Mathieu Desnoyers --- lttng-sessiond/context.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lttng-sessiond/context.c b/lttng-sessiond/context.c index 732dc929d..d36b3de80 100644 --- a/lttng-sessiond/context.c +++ b/lttng-sessiond/context.c @@ -260,14 +260,12 @@ static int add_ustctx_all_channels(struct ltt_ust_session *ustsession, // ustctx, ustchan->obj, &context_data); if (ret < 0) { ret = LTTCOMM_UST_CONTEXT_FAIL; - rcu_read_unlock(); goto error; } } else { ret = add_ustctx_to_event(ustsession, ustctx, ustchan, event_name); if (ret < 0) { ret = LTTCOMM_UST_CONTEXT_FAIL; - rcu_read_unlock(); goto error; } else if (ret == 1) { /* Event found and context added */ @@ -277,16 +275,13 @@ static int add_ustctx_all_channels(struct ltt_ust_session *ustsession, } hashtable_get_next(channels, &iter); } - rcu_read_unlock(); - if (!found && !no_event) { ret = LTTCOMM_NO_EVENT; goto error; } - ret = LTTCOMM_OK; - error: + rcu_read_unlock(); return ret; #endif return 0; -- 2.34.1