diff options
author | Harald Welte <laforge@osmocom.org> | 2019-12-01 13:38:35 +0100 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2019-12-01 13:48:55 +0100 |
commit | 797d533072c37f5aff0db3b019f636ea4e6b701a (patch) | |
tree | 4270c09d2086feb85a0a9afa13c77cebd48c583c /src/gb/gprs_ns.c | |
parent | ae5016f1938dfb87817cc6d9ceb84cb361e4b17e (diff) |
gprs_ns_instantiate(): propagate errors from gprs_sns_init() to caller
Change-Id: I71f347a2f0376716e5f83d33a7931eb8a99aad77
Diffstat (limited to 'src/gb/gprs_ns.c')
-rw-r--r-- | src/gb/gprs_ns.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index c77ebb37..ac39e4a6 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -1884,13 +1884,18 @@ static bool gprs_sns_fsm_registered = false; */ struct gprs_ns_inst *gprs_ns_instantiate(gprs_ns_cb_t *cb, void *ctx) { - struct gprs_ns_inst *nsi = talloc_zero(ctx, struct gprs_ns_inst); + struct gprs_ns_inst *nsi; if (!gprs_sns_fsm_registered) { - gprs_sns_init(); + int rc = gprs_sns_init(); + if (rc < 0) + return NULL; gprs_sns_fsm_registered = true; } + nsi = talloc_zero(ctx, struct gprs_ns_inst); + if (!nsi) + return NULL; nsi->cb = cb; INIT_LLIST_HEAD(&nsi->gprs_nsvcs); nsi->timeout[NS_TOUT_TNS_BLOCK] = 3; |