Change in libosmocore[master]: timerfd_create(): Fix error handling of osmo_fd_register()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Oct 21 10:33:23 UTC 2018


Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/11413


Change subject: timerfd_create(): Fix error handling of osmo_fd_register()
......................................................................

timerfd_create(): Fix error handling of osmo_fd_register()

Change-Id: Ia2528cc3e3155bbc9cb32dee0e3af99cc6e1c654
Closes: Coverity CID#188853
---
M src/select.c
1 file changed, 7 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/13/11413/1

diff --git a/src/select.c b/src/select.c
index 0b115c6..b07ad8c 100644
--- a/src/select.c
+++ b/src/select.c
@@ -324,11 +324,17 @@
 	ofd->when = BSC_FD_READ;
 
 	if (ofd->fd < 0) {
+		int rc;
+
 		ofd->fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
 		if (ofd->fd < 0)
 			return ofd->fd;
 
-		osmo_fd_register(ofd);
+		rc = osmo_fd_register(ofd);
+		if (rc < 0) {
+			close(ofd->fd);
+			return rc;
+		}
 	}
 	return 0;
 }

-- 
To view, visit https://gerrit.osmocom.org/11413
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia2528cc3e3155bbc9cb32dee0e3af99cc6e1c654
Gerrit-Change-Number: 11413
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181021/60b59117/attachment.htm>


More information about the gerrit-log mailing list