From 480c8acc8bf79db606079ba23f7e09f754ae4c84 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Tue, 5 Jan 2021 15:06:24 +0100 Subject: [PATCH] gprs_rlcmac_sched: fix incorrect SBA frame number assignment There is a big difference between: if ((a = foo() != 0xffffffff)) { ... } and if ((a = foo()) != 0xffffffff) { ... } In the first case, 'a' is the result of '!=' operation, i.e. either 0 (false) or 1 (true). In the second case, 'a' will hold the value returned by foo(), and this is exactly what must have been used in gprs_rlcmac_rcv_rts_block(). The bug was there since SBA allocation feature was added in 2012. Change-Id: Ifd607ae8a33382e48f9d9e50a28a4bdf4eaf73a2 Fixes: 07e97cf8a551b05d7f5f3f9583b68b2eff0f1c23 Related: CID#215835 --- src/gprs_rlcmac_sched.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index caf121f1..d7958c4c 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -448,7 +448,7 @@ int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_bts *bts, block_nr, poll_fn, tbf_name(tbf_cand.poll)); usf = USF_UNUSED; /* else. check for sba */ - } else if ((sba_fn = bts->bts->sba()->sched(trx, ts, fn, block_nr) != 0xffffffff)) { + } else if ((sba_fn = bts->bts->sba()->sched(trx, ts, fn, block_nr)) != 0xffffffff) { LOGP(DRLCMACSCHED, LOGL_DEBUG, "Received RTS for PDCH: TRX=%d " "TS=%d FN=%d block_nr=%d scheduling free USF for " "single block allocation at FN=%d\n", trx, ts, fn,