<p>Stefan Sperling has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/11783">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">add missing check of osmo_wqueue_enqueue() return value<br><br>The return value of osmo_wqueue_enqueue() isn't checked.<br>This can result in a memory leak if the message cannot<br>be enqueued. Log an error an free the message upon failure,<br>as done elsewhere.<br><br>Change-Id: I5671ca364f31d98f2b28d028e7bf1797386de2ec<br>Related: CID#57662<br>---<br>M src/osmo-bts-sysmo/l1_if.c<br>1 file changed, 5 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/83/11783/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c</span><br><span>index f682ffd..8657b79 100644</span><br><span>--- a/src/osmo-bts-sysmo/l1_if.c</span><br><span>+++ b/src/osmo-bts-sysmo/l1_if.c</span><br><span>@@ -549,7 +549,11 @@</span><br><span>            empty_req_from_l1sap(l1p, fl1, u8Tn, u32Fn, sapi, subCh, u8BlockNbr);</span><br><span>        }</span><br><span>    /* send message to DSP's queue */</span><br><span style="color: hsl(0, 100%, 40%);">-   osmo_wqueue_enqueue(&fl1->write_q[MQ_L1_WRITE], nmsg);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (osmo_wqueue_enqueue(&fl1->write_q[MQ_L1_WRITE], nmsg) != 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+              LOGPFN(DL1P, LOGL_ERROR, u32Fn, "MQ_L1_WRITE queue full. Dropping msg.\n");</span><br><span style="color: hsl(120, 100%, 40%);">+         msgb_free(nmsg);</span><br><span style="color: hsl(120, 100%, 40%);">+              return -EAGAIN;</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span>    if (dtx_is_first_p1(lchan))</span><br><span>          dtx_dispatch(lchan, E_FIRST);</span><br><span>        else</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/11783">change 11783</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/11783"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bts </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I5671ca364f31d98f2b28d028e7bf1797386de2ec </div>
<div style="display:none"> Gerrit-Change-Number: 11783 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Stefan Sperling <ssperling@sysmocom.de> </div>