From: Mathieu Desnoyers Date: Sun, 13 Nov 2011 17:28:43 +0000 (-0500) Subject: add_ustctx_all_channels: Move rcu_read_unlock in error label X-Git-Tag: v2.0-pre15~128 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=8ae38be72fa4066f3d64035ef41435ab2a24cc48;p=lttng-tools.git add_ustctx_all_channels: Move rcu_read_unlock in error label Signed-off-by: Mathieu Desnoyers --- 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;