<p>lynxis lazus has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/11020">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">sgsn_ggsn_ctx_drop_pdp: protect against nullpointer when MM is gone<br><br>When the GGSN crashs, the SGSN will be notified after<br>it comes back. Because of the async operation,<br>the mm ctx could be already gone.<br><br>Change-Id: I507a8c2193c84f8dff7f5d669adcd3583331f289<br>---<br>M src/gprs/gprs_sgsn.c<br>1 file changed, 3 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/20/11020/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c</span><br><span>index 977ae48..dc0e7c0 100644</span><br><span>--- a/src/gprs/gprs_sgsn.c</span><br><span>+++ b/src/gprs/gprs_sgsn.c</span><br><span>@@ -707,7 +707,9 @@</span><br><span> </span><br><span> void sgsn_ggsn_ctx_drop_pdp(struct sgsn_pdp_ctx *pctx)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-  if (pctx->mm->gmm_state == GMM_REGISTERED_NORMAL) {</span><br><span style="color: hsl(120, 100%, 40%);">+     /* the MM context can be deleted while the GGSN is not reachable or</span><br><span style="color: hsl(120, 100%, 40%);">+    * if has been crashed. */</span><br><span style="color: hsl(120, 100%, 40%);">+    if (pctx->mm && pctx->mm->gmm_state == GMM_REGISTERED_NORMAL) {</span><br><span>             gsm48_tx_gsm_deact_pdp_req(pctx, GSM_CAUSE_NET_FAIL, true);</span><br><span>          sgsn_ggsn_ctx_remove_pdp(pctx->ggsn, pctx);</span><br><span>       } else  {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/11020">change 11020</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/11020"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-sgsn </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I507a8c2193c84f8dff7f5d669adcd3583331f289 </div>
<div style="display:none"> Gerrit-Change-Number: 11020 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: lynxis lazus <lynxis@fe80.eu> </div>