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:
parent
2e21a68e83
commit
435f67f43c
|
@ -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)
|
int msc_tx_common_id(struct msc_a *msc_a, enum msc_role to_role)
|
||||||
{
|
{
|
||||||
struct vlr_subscr *vsub = msc_a_vsub(msc_a);
|
struct vlr_subscr *vsub = msc_a_vsub(msc_a);
|
||||||
|
if (vsub == NULL)
|
||||||
|
return -ENODEV;
|
||||||
struct ran_msg msg = {
|
struct ran_msg msg = {
|
||||||
.msg_type = RAN_MSG_COMMON_ID,
|
.msg_type = RAN_MSG_COMMON_ID,
|
||||||
.common_id = {
|
.common_id = {
|
||||||
|
|
Loading…
Reference in New Issue