sm: Fix potential null access due to missing check

Change-Id: I15532898f00c62cb2a63973decb401e929517cb3
changes/86/32486/1
Pau Espin 2023-04-25 17:17:10 +02:00
parent d4858baf35
commit 0eb8152aa1
1 changed files with 4 additions and 2 deletions

View File

@ -239,8 +239,10 @@ static int gprs_sm_prim_handle_smreg_pdp_act_req(struct osmo_gprs_sm_prim *sm_pr
OSMO_ASSERT(ms);
} else {
sme = gprs_sm_ms_get_pdp_ctx(ms, smreg->pdp_act_req.nsapi);
LOGSME(sme, LOGL_ERROR, "Rx SMREG-PDP-ACT.req for already existing PDP context\n");
return -EINVAL;
if (sme) {
LOGSME(sme, LOGL_ERROR, "Rx SMREG-PDP-ACT.req for already existing PDP context\n");
return -EINVAL;
}
}
sme = gprs_sm_entity_alloc(ms, smreg->pdp_act_req.nsapi);