Change in ...osmo-sgsn[master]: gprs_gmm: Introduce assert to guard against unexpected condition

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Mon Aug 12 17:14:55 UTC 2019


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/15167


Change subject: gprs_gmm: Introduce assert to guard against unexpected condition
......................................................................

gprs_gmm: Introduce assert to guard against unexpected condition

This may well be the culprit of OS#3957, were already freed llme is accessed from
mmctx context.

Related: OS#3957

Change-Id: I8e1eaeb9b3ebee8e45704b4fe007190c7db609e4
---
M src/gprs/gprs_gmm.c
1 file changed, 4 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/67/15167/1

diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c
index c8bc0f7..672864f 100644
--- a/src/gprs/gprs_gmm.c
+++ b/src/gprs/gprs_gmm.c
@@ -1741,6 +1741,10 @@
 			"The MM context cannot be used, RA: %03d-%0*d-%d-%d\n",
 			mmctx->ra.mcc, mmctx->ra.mnc_3_digits, mmctx->ra.mnc,
 			mmctx->ra.lac, mmctx->ra.rac);
+		/* mmctx is set to NULL and gprs_llgmm_unassign(llme) will be
+		   called below, let's make sure we don't keep dangling llme
+		   pointers in mmctx (OS#3957). */
+		OSMO_ASSERT(!(mmctx->ran_type == MM_CTX_T_GERAN_Gb && mmctx->gb.llme == NULL));
 		mmctx = NULL;
 	}
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/15167
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I8e1eaeb9b3ebee8e45704b4fe007190c7db609e4
Gerrit-Change-Number: 15167
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190812/da6de72a/attachment.htm>


More information about the gerrit-log mailing list