@@ -1051,7 +1051,7 @@
int i;
char *name = "";
- if (lchan && lchan->conn && lchan->conn->subscr)
+ if (lchan && lchan->conn)
name = subscr_name(lchan->conn->subscr);
DEBUGP(DMEAS, "[%s] MEASUREMENT RESULT NR=%d ", name, mr->nr);
@@ -43,6 +43,9 @@
char *subscr_name(struct gsm_subscriber *subscr)
{
+ if (!subscr)
+ return "unknown";
+
if (strlen(subscr->name))
return subscr->name;
@@ -447,8 +447,7 @@
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);
@@ -1153,9 +1152,7 @@
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: