diff --git a/src/genl/genl_pdr.c b/src/genl/genl_pdr.c index 971be16..ff854fb 100644 --- a/src/genl/genl_pdr.c +++ b/src/genl/genl_pdr.c @@ -473,7 +473,9 @@ static int pdr_fill(struct pdr *pdr, struct gtp5g_dev *gtp, struct genl_info *in pdr->af = AF_INET; far = find_far_by_id(gtp, pdr->seid, *pdr->far_id); - rcu_assign_pointer(pdr->far, far); + if (!far) { + return -EINVAL; + } err = far_set_pdr(pdr, gtp); if (err) diff --git a/src/gtpu/encap.c b/src/gtpu/encap.c index 54e143d..7480b33 100644 --- a/src/gtpu/encap.c +++ b/src/gtpu/encap.c @@ -617,6 +617,8 @@ int update_urr_counter_and_send_report(struct pdr *pdr, struct far *far, u64 vol for (i = 0; i < pdr->urr_num; i++) { urr = find_urr_by_id(gtp, pdr->seid, pdr->urr_ids[i]); + if (!urr) + continue; mnop = false; if (urr->info & URR_INFO_MNOP)