laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36132?usp=email )

Change subject: osmo_io_uring: Check if osmo_fd_register fails at 
iofd_uring_notify_connected()
......................................................................

osmo_io_uring: Check if osmo_fd_register fails at iofd_uring_notify_connected()

If it fails, do not set the IOFD_FLAG_NOTIFY_CONNECTED flag and log an
error message.

Closes: Coverity CID#349579
Change-Id: I34e8cc9a2b9df0c624841e5f9268a15c32418da1
---
M src/core/osmo_io_uring.c
1 file changed, 17 insertions(+), 2 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/src/core/osmo_io_uring.c b/src/core/osmo_io_uring.c
index cb636da..b174b22 100644
--- a/src/core/osmo_io_uring.c
+++ b/src/core/osmo_io_uring.c
@@ -496,8 +496,10 @@
                if (!IOFD_FLAG_ISSET(iofd, IOFD_FLAG_NOTIFY_CONNECTED)) {
                        osmo_fd_setup(&iofd->u.uring.connect_ofd, iofd->fd, 
OSMO_FD_WRITE,
                                      iofd_uring_connected_cb, iofd, 0);
-                       osmo_fd_register(&iofd->u.uring.connect_ofd);
-                       IOFD_FLAG_SET(iofd, IOFD_FLAG_NOTIFY_CONNECTED);
+                       if (osmo_fd_register(&iofd->u.uring.connect_ofd) < 0)
+                               LOGPIO(iofd, LOGL_ERROR, "Failed to register FD 
for connect event.\n");
+                       else
+                               IOFD_FLAG_SET(iofd, IOFD_FLAG_NOTIFY_CONNECTED);
                }
        } else
                iofd_uring_write_enable(iofd);

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36132?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I34e8cc9a2b9df0c624841e5f9268a15c32418da1
Gerrit-Change-Number: 36132
Gerrit-PatchSet: 2
Gerrit-Owner: jolly <andr...@eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <lafo...@osmocom.org>
Gerrit-MessageType: merged

Reply via email to