Fix: unchecked return value in ust app delete
[lttng-tools.git] / src / bin / lttng-sessiond / ust-app.c
index 72a3223c1fa53baa0bf8f413e9e9e99d7e6d335d..8dedb8730b8285f75cf51bf638ca2ac939d3af53 100644 (file)
@@ -406,7 +406,8 @@ void delete_ust_app_channel(int sock, struct ust_app_channel *ua_chan,
        if (ua_chan->obj != NULL) {
                /* Remove channel from application UST object descriptor. */
                iter.iter.node = &ua_chan->ust_objd_node.node;
-               lttng_ht_del(app->ust_objd, &iter);
+               ret = lttng_ht_del(app->ust_objd, &iter);
+               assert(!ret);
                ret = ustctl_release_object(sock, ua_chan->obj);
                if (ret < 0 && ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
                        ERR("UST app sock %d release channel obj failed with ret %d",
@@ -495,6 +496,11 @@ push_data:
                if (ret == -LTTCOMM_CONSUMERD_CHANNEL_FAIL) {
                        ret = 0;
                }
+
+               /* Update back the actual metadata len sent since it failed here. */
+               pthread_mutex_lock(&registry->lock);
+               registry->metadata_len_sent -= len;
+               pthread_mutex_unlock(&registry->lock);
                ret_val = ret;
                goto error_push;
        }
This page took 0.025556 seconds and 4 git commands to generate.