summaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-04-25 13:34:41 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-04-25 19:24:30 +0200
commit2ae1f5b7e09c90a3e7b296053a27d37baaa573a6 (patch)
treecd85e08e1128984a8e958efb8b512678da79fcf8 /openbsc
parent63b99ced83773d92310211d557009e1c8cc4faf4 (diff)
paging response: remove extraneous null check, assert conn and msg further up
In handle_paging_response(), don't check conn against NULL after using it all the time anyway. To ensure beyond doubt that it is actually never NULL, assert conn further up in the call stack, i.e. in gsm0408_dispatch(), the main entry point for receiving data from the BSC/RNC level. Also assert msg while at it. Fixes: CID#93769
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/libmsc/gsm_04_08.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index cccb8f717..454f22f68 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -1276,7 +1276,7 @@ static int handle_paging_resp(struct gsm_subscriber_connection *conn,
llist_del(&req->entry);
req = NULL;
- if (conn && cbfn) {
+ if (cbfn) {
LOGP(DPAG, LOGL_DEBUG, "Calling paging cbfn.\n");
cbfn(GSM_HOOK_RR_PAGING, GSM_PAGING_SUCCEEDED,
msg, conn, param);
@@ -3671,6 +3671,9 @@ int gsm0408_dispatch(struct gsm_subscriber_connection *conn, struct msgb *msg)
uint8_t pdisc = gsm48_hdr_pdisc(gh);
int rc = 0;
+ OSMO_ASSERT(conn);
+ OSMO_ASSERT(msg);
+
LOGP(DRLL, LOGL_DEBUG, "Dispatching 04.08 message, pdisc=%d\n", pdisc);
if (silent_call_reroute(conn, msg))
return silent_call_rx(conn, msg);