Fix nr_callbacks
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 29 Oct 2022 00:30:38 +0000 (20:30 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 29 Oct 2022 00:30:38 +0000 (20:30 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/side.c

index 02cef042435616052228b5d98a7359728f77c038..9d2ef5738479956bd3a3ac264db3164c61d09655 100644 (file)
@@ -300,14 +300,13 @@ struct side_events_register_handle *side_events_register(struct side_event_descr
 static
 void side_event_remove_callbacks(struct side_event_description *desc)
 {
 static
 void side_event_remove_callbacks(struct side_event_description *desc)
 {
-       uint32_t nr_cb = *desc->enabled & SIDE_EVENT_ENABLED_USER_MASK;
+       uint32_t nr_cb = desc->nr_callbacks;
        struct side_callback *old_cb;
 
        if (!nr_cb)
                return;
        old_cb = (struct side_callback *) desc->callbacks;
        struct side_callback *old_cb;
 
        if (!nr_cb)
                return;
        old_cb = (struct side_callback *) desc->callbacks;
-       if (desc->nr_callbacks)
-               (void) __atomic_add_fetch(desc->enabled, -1, __ATOMIC_RELAXED);
+       (void) __atomic_add_fetch(desc->enabled, -1, __ATOMIC_RELAXED);
        /*
         * Setting the state back to 0 cb and empty callbacks out of
         * caution. This should not matter because instrumentation is
        /*
         * Setting the state back to 0 cb and empty callbacks out of
         * caution. This should not matter because instrumentation is
This page took 0.025739 seconds and 4 git commands to generate.