aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc/gsm_04_08.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2015-12-28 14:04:36 +0100
committerDaniel Willmann <dwillmann@sysmocom.de>2016-02-04 15:41:26 +0100
commit92b80df446889d98d45b1ac09b2de18a5ad4cfa4 (patch)
treeeeaaa95a21127d36410662d6d4fba86f5d1c238a /openbsc/src/libmsc/gsm_04_08.c
parenta160672ca22e2c4d13741c71622fae2f903b3157 (diff)
subscr_name(): Handle case for subscr == NULL
subscr_name() was called from several places: * either without a check for subscr being NULL, which for example was causing a segfault if we hand-over a channel before identifying the subscriber * or with an explicit NULL check and the ternary operator (?). We now simplify the code by checking for the NULL Subscriber in subscr_name() itself.
Diffstat (limited to 'openbsc/src/libmsc/gsm_04_08.c')
-rw-r--r--openbsc/src/libmsc/gsm_04_08.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index d9d739032..d001d4543 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -447,8 +447,7 @@ int gsm0408_loc_upd_rej(struct gsm_subscriber_connection *conn, uint8_t cause)
msg->lchan = conn->lchan;
LOGP(DMM, LOGL_INFO, "Subscriber %s: LOCATION UPDATING REJECT "
- "LAC=%u BTS=%u\n", conn->subscr ?
- subscr_name(conn->subscr) : "unknown",
+ "LAC=%u BTS=%u\n", subscr_name(conn->subscr),
bts->location_area_code, bts->nr);
return gsm48_conn_sendmsg(msg, conn, NULL);
@@ -1147,9 +1146,7 @@ static int gsm0408_rcv_mm(struct gsm_subscriber_connection *conn, struct msgb *m
break;
case GSM48_MT_MM_TMSI_REALL_COMPL:
DEBUGP(DMM, "TMSI Reallocation Completed. Subscriber: %s\n",
- conn->subscr ?
- subscr_name(conn->subscr) :
- "unknown subscriber");
+ subscr_name(conn->subscr));
release_loc_updating_req(conn, 1);
break;
case GSM48_MT_MM_IMSI_DETACH_IND: