Fix: relayd: live: unchecked poll set creation return value
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 18 Feb 2020 00:46:18 +0000 (19:46 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 18 Feb 2020 19:33:25 +0000 (14:33 -0500)
The fd_tracker_util_poll_create function can fail because of fd
exhaustion or because the underlying epoll call fails.

In both cases, report and handle the error.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ie79fdc011afda43395ac883c6648f983118cfddb

src/bin/lttng-relayd/live.c

index 3ddafe2a16fb0075c33cbf921b9fb91981cfa646..06cfa5c7bb64da3321af4c251bf3f2a50580091e 100644 (file)
@@ -439,6 +439,10 @@ int create_named_thread_poll_set(struct lttng_poll_event *events,
 
        ret = fd_tracker_util_poll_create(the_fd_tracker,
                        name, events, 1, LTTNG_CLOEXEC);
+       if (ret) {
+               PERROR("Failed to create \"%s\" poll file descriptor", name);
+               goto error;
+       }
 
        /* Add quit pipe */
        ret = lttng_poll_add(events, thread_quit_pipe[0], LPOLLIN | LPOLLERR);
This page took 0.026831 seconds and 4 git commands to generate.