diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-10-27 10:20:37 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-10-30 21:24:12 +0100 |
commit | b98dd9e24085bf6838b5f2a5717c3345d54acb51 (patch) | |
tree | 0ec13b7f36c7ec7524b07e704994ad2f4521b29f /src/sba.cpp | |
parent | 93e048fe272d1d20522c26b96fc7e777255c6906 (diff) |
sba: Move freeing a sba into a central place
Diffstat (limited to 'src/sba.cpp')
-rw-r--r-- | src/sba.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/sba.cpp b/src/sba.cpp index ddcbe52e..6eec235f 100644 --- a/src/sba.cpp +++ b/src/sba.cpp @@ -124,12 +124,16 @@ uint32_t SBAController::sched(uint8_t trx, uint8_t ts, uint32_t fn, uint8_t bloc int SBAController::timeout(struct gprs_rlcmac_sba *sba) { LOGP(DRLCMAC, LOGL_NOTICE, "Poll timeout for SBA\n"); - llist_del(&sba->list); m_bts.sba_timedout(); + free_sba(sba); + return 0; +} + +void SBAController::free_sba(gprs_rlcmac_sba *sba) +{ m_bts.sba_freed(); + llist_del(&sba->list); talloc_free(sba); - - return 0; } void SBAController::free_resources(struct gprs_rlcmac_pdch *pdch) @@ -139,10 +143,7 @@ void SBAController::free_resources(struct gprs_rlcmac_pdch *pdch) const uint8_t ts_no = pdch->ts_no; llist_for_each_entry_safe(sba, sba2, &m_sbas, list) { - if (sba->trx_no == trx_no && sba->ts_no == ts_no) { - llist_del(&sba->list); - m_bts.sba_freed(); - talloc_free(sba); - } + if (sba->trx_no == trx_no && sba->ts_no == ts_no) + free_sba(sba); } } |