add_ustctx_all_channels: Move rcu_read_unlock in error label
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 13 Nov 2011 17:28:43 +0000 (12:28 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 13 Nov 2011 17:28:43 +0000 (12:28 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng-sessiond/context.c

index 732dc929d55ca8a1fa81dcab50bc31dc438c5f80..d36b3de80fe318b2b72eceb4ba3064cd6489639b 100644 (file)
@@ -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;
This page took 0.025989 seconds and 4 git commands to generate.