From cac027d69548f3baa7cac0c75d7cadffa4d40efc Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Tue, 8 May 2018 09:48:10 -0500 Subject: [PATCH] Merge branch 'issue_incorrect_dci' into raa_new --- srsue/hdr/mac/dl_harq.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/srsue/hdr/mac/dl_harq.h b/srsue/hdr/mac/dl_harq.h index c56031ef3..47ebb209f 100644 --- a/srsue/hdr/mac/dl_harq.h +++ b/srsue/hdr/mac/dl_harq.h @@ -280,7 +280,10 @@ private: memcpy(&cur_grant, &grant, sizeof(Tgrant)); if (payload_buffer_ptr) { - Warning("DL PID %d: Allocating buffer already allocated\n", pid); + Warning("DL PID %d: Allocating buffer already allocated. Deallocating.\n", pid); + if (pid != HARQ_BCCH_PID) { + harq_entity->demux_unit->deallocate(payload_buffer_ptr); + } } // Instruct the PHY To combine the received data and attempt to decode it @@ -296,7 +299,7 @@ private: pthread_mutex_unlock(&mutex); return; } - action->decode_enabled[tid]= true; + action->decode_enabled[tid] = true; action->rv[tid] = cur_grant.rv[tid]; action->softbuffers[tid] = &softbuffer; memcpy(&action->phy_grant, &cur_grant.phy_grant, sizeof(Tphygrant)); @@ -327,11 +330,13 @@ private: } } - pthread_mutex_unlock(&mutex); + if (!action->decode_enabled[tid]) { + pthread_mutex_unlock(&mutex); + } + } void tb_decoded(bool ack_) { - pthread_mutex_lock(&mutex); ack = ack_; if (ack) { if (pid == HARQ_BCCH_PID) {