When unregistering a trigger that was previously registered, the
agent corresponding to the trigger's domain will already exist. It is
superfluous to handle the case where it doesn't exist and it would only
hide an internal error.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ifc6d14b74586af8423a70b3466e0a2c00491d3c3
struct agent *agt = agent_find_by_event_notifier_domain(
trigger_domain);
- if (!agt) {
- agt = agent_create(trigger_domain);
- if (!agt) {
- ret_code = LTTNG_ERR_NOMEM;
- goto end_unlock_session_list;
- }
-
- agent_add(agt, trigger_agents_ht_by_domain);
- }
-
+ /*
+ * This trigger was never registered in the first place. Calling
+ * this function under those circumstances is an internal error.
+ */
+ assert(agt);
ret_code = trigger_agent_disable(trigger, agt);
if (ret_code != LTTNG_OK) {
goto end_unlock_session_list;