path: root/openbsc/src
diff options
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-06-02 09:31:04 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-06-02 09:46:11 +0200
commit65b0efe56eafff992d60854787b83275ac33f84e (patch)
tree28082b6fac5c09529c7f9c41d574bb397b0ae9c9 /openbsc/src
parentc36a13b073d39a5249418e7e0e78b7a45bfeb310 (diff)
sgsn: Check the return value of osmo_fd_register
We can't do much in case the fd is failing to be registered. There should be a timeout that is catching this and it might be able to repair it self. Fixes: Coverity CID#1302854
Diffstat (limited to 'openbsc/src')
1 files changed, 2 insertions, 1 deletions
diff --git a/openbsc/src/gprs/sgsn_ares.c b/openbsc/src/gprs/sgsn_ares.c
index eabf9401d..dd1bdb57b 100644
--- a/openbsc/src/gprs/sgsn_ares.c
+++ b/openbsc/src/gprs/sgsn_ares.c
@@ -114,7 +114,8 @@ static void setup_ares_osmo_fd(void *data, int fd, int read, int write)
ufd->fd.fd = fd;
ufd->fd.cb = ares_osmo_fd_cb;
ufd->fd.data = data;
- osmo_fd_register(&ufd->fd);
+ if (osmo_fd_register(&ufd->fd) != 0)
+ LOGP(DGPRS, LOGL_ERROR, "Failed to register C-ares fd (%d)\n", fd);
llist_add(&ufd->head, &sgsn->ares_fds);