fixeria submitted this change.

View Change


Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved fixeria: Looks good to me, approved
ASCI: Fix false return value checks, discovered by Coverity Scan

See: CID 32637 - 323644

Related: OS#5364
Change-Id: If72590bb94597e434386bbcd312919a71abf0aae
---
M src/host/layer23/src/mobile/gsm44068_gcc_bcc.c
1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/src/host/layer23/src/mobile/gsm44068_gcc_bcc.c b/src/host/layer23/src/mobile/gsm44068_gcc_bcc.c
index fa0e7bd..7bb8b29 100644
--- a/src/host/layer23/src/mobile/gsm44068_gcc_bcc.c
+++ b/src/host/layer23/src/mobile/gsm44068_gcc_bcc.c
@@ -622,7 +622,7 @@
{
struct gsm_trans *trans = fi->priv;
uint8_t *cause = data;
- uint8_t transaction_id;
+ int rc;

switch (event) {
case VGCS_GCC_EV_TERM_REQ:
@@ -649,13 +649,13 @@
/* Change to GROUP CALL INITIATED state. */
osmo_fsm_inst_state_chg(fi, VGCS_GCC_ST_U1_GROUP_CALL_INITIATED, 0, 0);
/* Choose transaction ID. */
- transaction_id = trans_assign_trans_id(trans->ms, trans->protocol, 0);
- if (transaction_id < 0) {
+ rc = trans_assign_trans_id(trans->ms, trans->protocol, 0);
+ if (rc < 0) {
/* No free transaction ID. */
trans_free(trans);
return;
}
- trans->transaction_id = transaction_id;
+ trans->transaction_id = rc;
/* Send SETUP towards network. */
gsm44068_tx_setup(trans, trans->callref, false, 0, false, NULL, 0, false, 0);
break;
@@ -1500,7 +1500,7 @@
struct gsm_trans *trans;

trans = trans_alloc(ms, pdisc, 0xff, callref);
- if (trans < 0)
+ if (!trans)
return NULL;
trans->gcc.fi = osmo_fsm_inst_alloc((pdisc == GSM48_PDISC_GROUP_CC) ? &vgcs_gcc_fsm : &vgcs_bcc_fsm,
trans, trans, LOGL_DEBUG, NULL);
@@ -1664,7 +1664,7 @@
return 0;
/* Incoming notification, creation transaction. */
trans = trans_alloc_vgcs(ms, pdisc, 0xff, mmh->ref);
- if (trans < 0)
+ if (!trans)
return -ENOMEM;
} else {
LOG_GCC_PR(pdisc, mmh->ref, LOGL_ERROR, "Received GCC/BCC message for unknown transaction.\n");
@@ -1816,7 +1816,7 @@

/* Create new transaction. ORIG will be set when entering U2sl state. */
trans = trans_alloc_vgcs(ms, protocol, 0xff, callref);
- if (trans < 0)
+ if (!trans)
return -ENOMEM;

/* Setup new call. */

To view, visit change 34646. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: If72590bb94597e434386bbcd312919a71abf0aae
Gerrit-Change-Number: 34646
Gerrit-PatchSet: 2
Gerrit-Owner: jolly <andreas@eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged