msc_tx_common_id(): fix potential NULL pointer dereference

Reported by GCC 11.1.0.  msc_a_vsub() may return NULL.

Change-Id: Iebdd6399e819a03258398e6b7b453bda37e45a20
This commit is contained in:
Vadim Yanitskiy 2021-06-06 15:47:49 +02:00
parent 2e21a68e83
commit 435f67f43c
1 changed files with 2 additions and 0 deletions

View File

@ -1638,6 +1638,8 @@ struct msc_a *msc_a_for_vsub(const struct vlr_subscr *vsub, bool valid_conn_only
int msc_tx_common_id(struct msc_a *msc_a, enum msc_role to_role)
{
struct vlr_subscr *vsub = msc_a_vsub(msc_a);
if (vsub == NULL)
return -ENODEV;
struct ran_msg msg = {
.msg_type = RAN_MSG_COMMON_ID,
.common_id = {