<p>Vadim Yanitskiy <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/12588">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Jenkins Builder: Verified
Harald Welte: Looks good to me, approved
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">trxcon/trx_if.c: check if trx_fsm allocation failed<br><br>Change-Id: I31c9f2a651182b258d0a4d4504365b778529715a<br>---<br>M src/host/trxcon/trx_if.c<br>1 file changed, 11 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/host/trxcon/trx_if.c b/src/host/trxcon/trx_if.c</span><br><span>index 91b87a2..bff73cc 100644</span><br><span>--- a/src/host/trxcon/trx_if.c</span><br><span>+++ b/src/host/trxcon/trx_if.c</span><br><span>@@ -645,6 +645,16 @@</span><br><span> return -ENOMEM;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ /* Allocate a new dedicated state machine */</span><br><span style="color: hsl(120, 100%, 40%);">+ trx_new->fsm = osmo_fsm_inst_alloc(&trx_fsm, trx_new,</span><br><span style="color: hsl(120, 100%, 40%);">+ NULL, LOGL_DEBUG, "trx_interface");</span><br><span style="color: hsl(120, 100%, 40%);">+ if (trx_new->fsm == NULL) {</span><br><span style="color: hsl(120, 100%, 40%);">+ LOGP(DTRX, LOGL_ERROR, "Failed to allocate an instance "</span><br><span style="color: hsl(120, 100%, 40%);">+ "of FSM '%s'\n", trx_fsm.name);</span><br><span style="color: hsl(120, 100%, 40%);">+ talloc_free(trx_new);</span><br><span style="color: hsl(120, 100%, 40%);">+ return -ENOMEM;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* Initialize CTRL queue */</span><br><span> INIT_LLIST_HEAD(&trx_new->trx_ctrl_list);</span><br><span> </span><br><span>@@ -659,16 +669,13 @@</span><br><span> if (rc < 0)</span><br><span> goto error;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- /* Allocate a new dedicated state machine */</span><br><span style="color: hsl(0, 100%, 40%);">- trx_new->fsm = osmo_fsm_inst_alloc(&trx_fsm, trx_new,</span><br><span style="color: hsl(0, 100%, 40%);">- NULL, LOGL_DEBUG, "trx_interface");</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> *trx = trx_new;</span><br><span> </span><br><span> return 0;</span><br><span> </span><br><span> error:</span><br><span> LOGP(DTRX, LOGL_ERROR, "Couldn't establish UDP connection\n");</span><br><span style="color: hsl(120, 100%, 40%);">+ osmo_fsm_inst_free(trx_new->fsm);</span><br><span> talloc_free(trx_new);</span><br><span> return rc;</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/12588">change 12588</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/12588"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: osmocom-bb </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I31c9f2a651182b258d0a4d4504365b778529715a </div>
<div style="display:none"> Gerrit-Change-Number: 12588 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Vadim Yanitskiy <axilirator@gmail.com> </div>