Fix possible use of uninitialized variable
[lttng-tools.git] / ltt-sessiond / main.c
index 7532e2c3bdde96e18c6d82772bf2b9ae3fbb146c..46c98a5611b9e818c0c99e7e7a64bcd56a02b60e 100644 (file)
@@ -701,6 +701,12 @@ static void *thread_manage_kernel(void *data)
 
        while (1) {
                if (update_poll_flag == 1) {
+                       /*
+                        * Reset number of fd in the poll set. Always 2 since there is the thread
+                        * quit pipe and the kernel pipe.
+                        */
+                       events.nb_fd = 2;
+
                        ret = update_kernel_poll(&events);
                        if (ret < 0) {
                                goto error;
@@ -1432,12 +1438,13 @@ static int mount_debugfs(char *path)
 
        ret = mkdir_recursive(path, S_IRWXU | S_IRWXG, geteuid(), getegid());
        if (ret < 0) {
+               PERROR("Cannot create debugfs path");
                goto error;
        }
 
        ret = mount(type, path, type, 0, NULL);
        if (ret < 0) {
-               perror("mount debugfs");
+               PERROR("Cannot mount debugfs");
                goto error;
        }
 
@@ -1487,6 +1494,7 @@ static void init_kernel_tracer(void)
                }
                ret = mount_debugfs(debugfs_path);
                if (ret < 0) {
+                       perror("Cannot mount debugfs");
                        goto error;
                }
        }
@@ -1565,7 +1573,7 @@ static int create_ust_session(struct ltt_session *session,
                struct lttng_domain *domain)
 {
        int ret;
-       struct ltt_ust_session *lus;
+       struct ltt_ust_session *lus = NULL;
        struct ust_app *app;
 
        switch (domain->type) {
@@ -1577,6 +1585,7 @@ static int create_ust_session(struct ltt_session *session,
                }
                break;
        default:
+               ret = LTTCOMM_UNKNOWN_DOMAIN;
                goto error;
        }
 
@@ -2304,7 +2313,7 @@ static int cmd_destroy_session(struct ltt_session *session, char *name)
                perror("write kernel poll pipe");
        }
 
-       ret = session_destroy(name);
+       ret = session_destroy(session);
 
        return ret;
 }
This page took 0.02481 seconds and 4 git commands to generate.