timerfd: call osmo_fd_unregister() when closing on read error

Change-Id: I8513126286083ebf02d14043cf072c8297878dd7
This commit is contained in:
Harald Welte 2020-04-18 21:16:43 +02:00 committed by laforge
parent 06747d5720
commit 100e44ed49
1 changed files with 1 additions and 0 deletions

View File

@ -382,6 +382,7 @@ int osmo_timerfd_setup(struct osmo_fd *ofd, int (*cb)(struct osmo_fd *, unsigned
rc = osmo_fd_register(ofd);
if (rc < 0) {
osmo_fd_unregister(ofd);
close(ofd->fd);
ofd->fd = -1;
return rc;