event_agent_disable_all contains comments which make no sense since
they were blindly copy-pasted from event_agent_enable_all.
Also add an error_unlock label instead of open coding the unlock
on error.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
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) {
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;
}