From: Jérémie Galarneau Date: Tue, 18 Feb 2020 00:35:52 +0000 (-0500) Subject: Fix: relayd: unchecked poll set creation return value X-Git-Tag: v2.12.0-rc2~63 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=11eecdde0092f831fa5a979478c998307e7aa8d8;p=lttng-tools.git Fix: relayd: unchecked poll set creation return value 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 Change-Id: Id1e35d43442e74dd6784a9a4e235576a5bf135e2 --- diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index 3aef0fabc..cbd9e9cc7 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -918,6 +918,10 @@ static 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);