abis_rsl_rx_dchan(): guard against lchan_lookup() returning NULL

Found this by coincidence, no actual failure case was observed.

lchan_lookup() does have a return NULL code path, so we should not blindly use
its returned pointer.

Change-Id: I34ce126d36420b8194c88c0faa865294334a6658
This commit is contained in:
Neels Hofmeyr 2016-10-10 03:24:05 +02:00
parent 5275c152e5
commit a6ba6a370b
1 changed files with 2 additions and 0 deletions

View File

@ -1456,6 +1456,8 @@ static int abis_rsl_rx_dchan(struct msgb *msg)
msg->lchan = lchan_lookup(sign_link->trx, rslh->chan_nr,
"Abis RSL rx DCHAN: ");
if (!msg->lchan)
return -1;
ts_name = gsm_lchan_name(msg->lchan);
switch (rslh->c.msg_type) {