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
This commit is contained in:
Neels Hofmeyr
2016-04-25 13:34:41 +02:00
parent 63b99ced83
commit 2ae1f5b7e0

View File

@@ -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);