osmith has uploaded this change for review.

View Change

check_chan_mode_rate_against…: fix never true cond

Fixes: CID#310958
Fixes: 2150b307 ("assignment_fsm: chan mode check: support CSD")
Change-Id: Icb3d0f977267dca7b52fd05312ccb5237fcaa031
---
M src/osmo-bsc/assignment_fsm.c
1 file changed, 16 insertions(+), 5 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/14/31714/1
diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c
index 3d4c38f..e21a036 100644
--- a/src/osmo-bsc/assignment_fsm.c
+++ b/src/osmo-bsc/assignment_fsm.c
@@ -397,22 +397,22 @@
struct assignment_request *req = &conn->assignment.req;
struct osmo_fsm_inst *fi = conn->fi;
int i;
- uint8_t ch_indctr;
+ int rc;

for (i = 0; i < req->n_ch_mode_rate; i++) {
- ch_indctr = chan_mode_to_ch_indctr(req->ch_mode_rate_list[i].chan_mode);
- if (ch_indctr < 0) {
+ rc = chan_mode_to_ch_indctr(req->ch_mode_rate_list[i].chan_mode);
+ if (rc < 0) {
assignment_fail(GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_NOT_SUPP,
"Channel mode not supported (prev level %d): %s", i,
gsm48_chan_mode_name(req->ch_mode_rate_list[i].chan_mode));
return -EINVAL;
}

- if (ch_indctr != req->ch_indctr) {
+ if (rc != req->ch_indctr) {
assignment_fail(GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_NOT_SUPP,
"Channel mode %s has ch_indctr %d, channel type has ch_indctr %d",
gsm48_chan_mode_name(req->ch_mode_rate_list[i].chan_mode),
- ch_indctr, req->ch_indctr);
+ rc, req->ch_indctr);
return -EINVAL;
}
}

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Icb3d0f977267dca7b52fd05312ccb5237fcaa031
Gerrit-Change-Number: 31714
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith@sysmocom.de>
Gerrit-MessageType: newchange