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: 178b92a108
Fixes: CID#300007
changes/87/30287/1
Vadim Yanitskiy 2 weeks ago
parent 178b92a108
commit 7f1b99bc3b
  1. 16
      src/host/trxcon/src/trx_if.c

@ -647,14 +647,6 @@ static int trx_data_rx_cb(struct osmo_fd *ofd, unsigned int what)
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 @@ static int trx_data_rx_cb(struct osmo_fd *ofd, unsigned int what)
.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;

Loading…
Cancel
Save