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: 629250 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 3rL7yB1Jtzz9t8g for ; Thu, 2 Jun 2016 23:54:42 +1000 (AEST) Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by lists.osmocom.org (Postfix) with ESMTP id F3D0B2221D; Thu, 2 Jun 2016 13:54:40 +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 9634B221DB; Thu, 2 Jun 2016 13:54:37 +0000 (UTC) Date: Thu, 2 Jun 2016 13:54:37 +0000 From: Holger Freyther To: Neels Hofmeyr , Harald Welte X-Gerrit-MessageType: merged Subject: [MERGED] openbsc[master]: gprs_gmm.c: Perform LLME operations only if we have one X-Gerrit-Change-Id: If7f24161cd2826f8ee238d4bc1090adf555cea4e X-Gerrit-ChangeURL: X-Gerrit-Commit: 2b2429eb59af1edc9e8760a441c8c457418a459c 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: <20160602135440.F3D0B2221D@lists.osmocom.org> Holger Freyther has submitted this change and it was merged. Change subject: gprs_gmm.c: Perform LLME operations only if we have one ...................................................................... gprs_gmm.c: Perform LLME operations only if we have one In case the GMM message did not arrive over a Gb interface, there is no LLME (and thus the associated pointer is NULL). Don't try to perform operations on a NULL LLME. Change-Id: If7f24161cd2826f8ee238d4bc1090adf555cea4e --- M openbsc/src/gprs/gprs_gmm.c 1 file changed, 7 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index d521342..c8f687b 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -1208,10 +1208,12 @@ } if (!mmctx) { - /* send a XID reset to re-set all LLC sequence numbers - * in the MS */ - LOGMMCTXP(LOGL_NOTICE, mmctx, "LLC XID RESET\n"); - gprs_llgmm_reset(llme); + if (llme) { + /* send a XID reset to re-set all LLC sequence numbers + * in the MS */ + LOGMMCTXP(LOGL_NOTICE, mmctx, "LLC XID RESET\n"); + gprs_llgmm_reset(llme); + } /* The MS has to perform GPRS attach */ /* Device is still IMSI attached for CS but initiate GPRS ATTACH, * see GSM 04.08, 4.7.5.1.4 and G.6 */ @@ -1314,7 +1316,7 @@ /* MMCTX can be NULL when called */ - if (!mmctx && + if (llme && !mmctx && gh->msg_type != GSM48_MT_GMM_ATTACH_REQ && gh->msg_type != GSM48_MT_GMM_RA_UPD_REQ) { LOGP(DMM, LOGL_NOTICE, "Cannot handle GMM for unknown MM CTX\n");