fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30287 )
Change subject: fixup: trxcon: make burst pointer in trxcon_phyif_burst_ind const ......................................................................
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(-)
Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved
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;