fixeria submitted this change.

View Change

Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved
fixup: trxcon: make burst pointer in trxcon_phyif_burst_ind const

The for-loop was moved above the initialization of bi and kept using
bi.burst_len, which is indeed uninitialized. Move it back.

Change-Id: I93a627233beef9157d47b35cafc42c53203619a7
Fixes: 178b92a1083b2348dafd066e16551cadcf90359d
Fixes: CID#300007
---
M src/host/trxcon/src/trx_if.c
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/host/trxcon/src/trx_if.c b/src/host/trxcon/src/trx_if.c
index 563af61..2c0b286 100644
--- a/src/host/trxcon/src/trx_if.c
+++ b/src/host/trxcon/src/trx_if.c
@@ -647,14 +647,6 @@

burst = (sbit_t *)&buf[8];

- /* Convert ubits {254..0} to sbits {-127..127} in-place */
- for (unsigned int i = 0; i < bi.burst_len; i++) {
- if (buf[8 + i] == 255)
- burst[i] = -127;
- else
- burst[i] = 127 - buf[8 + i];
- }
-
bi = (struct trxcon_phyif_burst_ind) {
.tn = buf[0],
.fn = osmo_load32be(buf + 1),
@@ -664,6 +656,14 @@
.burst_len = 148,
};

+ /* Convert ubits {254..0} to sbits {-127..127} in-place */
+ for (unsigned int i = 0; i < bi.burst_len; i++) {
+ if (buf[8 + i] == 255)
+ burst[i] = -127;
+ else
+ burst[i] = 127 - buf[8 + i];
+ }
+
if (bi.tn >= 8) {
LOGPFSMSL(trx->fi, DTRXD, LOGL_ERROR, "Illegal TS %d\n", bi.tn);
return -EINVAL;

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I93a627233beef9157d47b35cafc42c53203619a7
Gerrit-Change-Number: 30287
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged