Clean-up and simplify event_agent_disable_all
[lttng-tools.git] / src / bin / lttng-sessiond / event.c
index d7034efa5fc20175c019bd4426a1d3c4f0af1d6b..dacd56d33bd1985c76959c4982b1de85b1af521e 100644 (file)
@@ -634,7 +634,7 @@ int event_agent_disable_all(struct ltt_ust_session *usess,
                goto error;
        }
 
-       /* Flag every event that they are now enabled. */
+       /* Disable every event. */
        rcu_read_lock();
        cds_lfht_for_each_entry(agt->events->ht, &iter.iter, aevent,
                        node.node) {
@@ -644,14 +644,15 @@ int event_agent_disable_all(struct ltt_ust_session *usess,
 
                ret = event_agent_disable(usess, agt, aevent->name);
                if (ret != LTTNG_OK) {
-                       rcu_read_unlock();
-                       goto error;
+                       goto error_unlock;
                }
        }
        rcu_read_unlock();
 
        ret = LTTNG_OK;
 
+error_unlock:
+       rcu_read_unlock();
 error:
        return ret;
 }
This page took 0.023271 seconds and 4 git commands to generate.