From patchwork Thu Jun 2 13:54:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gerrit-no-reply@lists.osmocom.org X-Patchwork-Id: 629251 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.osmocom.org (lists.osmocom.org [IPv6:2a01:4f8:191:444b::2:7]) by ozlabs.org (Postfix) with ESMTP id 3rL7yJ1ktZz9sBm for ; Thu, 2 Jun 2016 23:54:48 +1000 (AEST) Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by lists.osmocom.org (Postfix) with ESMTP id DA1A822235; Thu, 2 Jun 2016 13:54:41 +0000 (UTC) X-Original-To: openbsc@lists.osmocom.org Delivered-To: openbsc@lists.osmocom.org Received: from 127.0.1.12 (unknown [127.0.1.12]) by lists.osmocom.org (Postfix) with ESMTPA id C0314221DC; Thu, 2 Jun 2016 13:54:37 +0000 (UTC) Date: Thu, 2 Jun 2016 13:54:37 +0000 From: Holger Freyther To: daniel , Neels Hofmeyr X-Gerrit-MessageType: merged Subject: [MERGED] openbsc[master]: sgsn_mm_ctx_cleanup_free(): clean up LLME iff present (Gb, n... X-Gerrit-Change-Id: I891ae21afc1f4f60580b822273b5435e0e17d46f X-Gerrit-ChangeURL: X-Gerrit-Commit: 7ec8ca422cb76c876dcd5c8a9e23d48090d40580 In-Reply-To: References: MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/2.12.2-67-g5fc9ca9-dirty X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Development of OpenBSC, OsmoBSC, OsmoNITB, OsmoCSCN" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: holger@freyther.de Errors-To: openbsc-bounces@lists.osmocom.org Sender: "OpenBSC" Message-Id: <20160602135441.DA1A822235@lists.osmocom.org> Holger Freyther has submitted this change and it was merged. Change subject: sgsn_mm_ctx_cleanup_free(): clean up LLME iff present (Gb, not Iu) ...................................................................... sgsn_mm_ctx_cleanup_free(): clean up LLME iff present (Gb, not Iu) Assert that llme is unused for non-Gb (Iu) connections, and clean up otherwise. Make sure the cleanup is left below the sgsn_mm_ctx_free() call, as the comment states. Change-Id: I891ae21afc1f4f60580b822273b5435e0e17d46f --- M openbsc/src/gprs/gprs_sgsn.c 1 file changed, 10 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c index 8bb6850..722edec 100644 --- a/openbsc/src/gprs/gprs_sgsn.c +++ b/openbsc/src/gprs/gprs_sgsn.c @@ -197,10 +197,15 @@ void sgsn_mm_ctx_cleanup_free(struct sgsn_mm_ctx *mm) { - struct gprs_llc_llme *llme = mm->gb.llme; + struct gprs_llc_llme *llme = NULL; uint32_t tlli = mm->gb.tlli; struct sgsn_pdp_ctx *pdp, *pdp2; struct sgsn_signal_data sig_data; + + if (mm->ran_type == MM_CTX_T_GERAN_Gb) + llme = mm->gb.llme; + else + OSMO_ASSERT(mm->gb.llme == NULL); /* Forget about ongoing look-ups */ if (mm->ggsn_lookup) { @@ -237,8 +242,10 @@ sgsn_mm_ctx_free(mm); mm = NULL; - /* TLLI unassignment, must be called after sgsn_mm_ctx_free */ - gprs_llgmm_assign(llme, tlli, 0xffffffff, GPRS_ALGO_GEA0, NULL); + if (llme) { + /* TLLI unassignment, must be called after sgsn_mm_ctx_free */ + gprs_llgmm_assign(llme, tlli, 0xffffffff, GPRS_ALGO_GEA0, NULL); + } }