Coverity reports:
CID
1171571 (#1 of 1): Unchecked return value (CHECKED_RETURN)
24. check_return: Calling compat_epoll_add without checking return
value (as is done elsewhere 11 out of 13 times).
CID
1171572 (#1 of 1): Unchecked return value (CHECKED_RETURN)
24. check_return: Calling compat_epoll_add without checking return
value (as is done elsewhere 11 out of 13 times).
Reported-by: Coverity (1171571) Unchecked return value
Reported-by: Coverity (1171572) Unchecked return value
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
if (ret < 0) {
goto error;
}
- lttng_poll_add(&events, conn->sock->fd,
+ ret = lttng_poll_add(&events,
+ conn->sock->fd,
LPOLLIN | LPOLLRDHUP);
+ if (ret) {
+ ERR("Failed to add new live connection file descriptor to poll set");
+ goto error;
+ }
connection_ht_add(viewer_connections_ht, conn);
DBG("Connection socket %d added to poll", conn->sock->fd);
} else if (revents & (LPOLLERR | LPOLLHUP | LPOLLRDHUP)) {
if (ret < 0) {
goto error;
}
- lttng_poll_add(&events, conn->sock->fd,
+ ret = lttng_poll_add(&events,
+ conn->sock->fd,
LPOLLIN | LPOLLRDHUP);
+ if (ret) {
+ ERR("Failed to add new connection file descriptor to poll set");
+ goto error;
+ }
connection_ht_add(relay_connections_ht, conn);
DBG("Connection socket %d added", conn->sock->fd);
} else if (revents & (LPOLLERR | LPOLLHUP | LPOLLRDHUP)) {