diff options
authorMax <msuraev@sysmocom.de>2017-09-18 16:10:18 +0200
committerMax <msuraev@sysmocom.de>2017-09-23 13:57:42 +0200
commit79605f68354ad862d6d521406ee235c43a11b089 (patch)
parent3b3080b93d270972b2e0a01398539b00b3243f15 (diff)
gbproxy: ensure peer allocation result
gbproxy_peer_alloc() could return NULL which wasn't checked and used right away. Fix it by making this assumption explicit with OSMO_ASSERT(); While at it, also format log messages consistently. Change-Id: Ib10c954e17a479baef31ded54370b35938e00018
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c
index eb2bbccd..17a01091 100644
--- a/src/gprs/gb_proxy.c
+++ b/src/gprs/gb_proxy.c
@@ -1018,9 +1018,9 @@ static int gbprox_rx_sig_from_bss(struct gbproxy_config *cfg,
if (!from_peer) {
/* if a PTP-BVC is reset, and we don't know that
* PTP-BVCI yet, we should allocate a new peer */
- LOGP(DGPRS, LOGL_INFO, "Allocationg new peer for "
- "BVCI=%u via NSEI=%u\n", bvci, nsei);
+ LOGP(DGPRS, LOGL_INFO, "Allocationg new peer for BVCI=%u via NSEI=%u\n", bvci, nsei);
from_peer = gbproxy_peer_alloc(cfg, bvci);
+ OSMO_ASSERT(from_peer);
from_peer->nsei = nsei;