diff options
authorPau Espin Pedrol <pespin@sysmocom.de>2021-07-26 14:37:39 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2021-07-26 14:39:46 +0200
commit26a42c07837d43c760f9fba98c82a5f9cff6aa51 (patch)
parentf26490b07bccb88ab1cd9915954c7e2b54657ece (diff)
gb/bssgp: Abort clearly if backward-compat API is used in wrong way
Some tests under osmo-pcu (TbfTest) were caught accessning NULL pointer bssgp_nsi in bssgp_tx_llc_discarded triggered by timeout while stepping slowly with the debugger. It seems that test is not properly using neither the old nor the new API. Let's catch such cases easily. Change-Id: I3ea42755c4bfd29e4a01ad57f186f28d58ab466a
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c
index 14a5e9de..c967f730 100644
--- a/src/gb/gprs_bssgp.c
+++ b/src/gb/gprs_bssgp.c
@@ -77,6 +77,7 @@ static int _bssgp_tx_dl_ud(struct bssgp_flow_control *fc, struct msgb *msg,
/* callback to be backward compatible with old users which do not set the bssgp_ns_send function */
static int _gprs_ns_sendmsg(void *ctx, struct msgb *msg)
+ OSMO_ASSERT(bssgp_nsi);
return gprs_ns_sendmsg(bssgp_nsi, msg);