Fix: RCU unlock out of error path
[lttng-tools.git] / src / bin / lttng-sessiond / ust-app.c
index 384f8e68812387e8188ad7ef24af80f0b14641e4..6076830099847be986b91be5378d9846c63d63b2 100644 (file)
@@ -2050,7 +2050,7 @@ int ust_app_create_channel_glb(struct ltt_ust_session *usess,
                if (ua_sess == NULL) {
                        /* The malloc() failed. */
                        ret = -1;
-                       goto error;
+                       goto error_rcu_unlock;
                } else if (ua_sess == (void *) -1UL) {
                        /* The application's socket is not valid. Contiuing */
                        ret = -1;
@@ -2062,13 +2062,12 @@ int ust_app_create_channel_glb(struct ltt_ust_session *usess,
                if (ua_chan == NULL) {
                        /* Major problem here and it's maybe the tracer or malloc() */
                        ret = -1;
-                       goto error;
+                       goto error_rcu_unlock;
                }
        }
 
+error_rcu_unlock:
        rcu_read_unlock();
-
-error:
        return ret;
 }
 
@@ -2581,10 +2580,7 @@ void ust_app_global_update(struct ltt_ust_session *usess, int sock)
        struct ust_app_event *ua_event;
        struct ust_app_ctx *ua_ctx;
 
-       if (usess == NULL) {
-               ERR("No UST session on global update. Returning");
-               goto error;
-       }
+       assert(usess);
 
        DBG2("UST app global update for app sock %d for session id %d", sock,
                        usess->id);
This page took 0.026446 seconds and 4 git commands to generate.