Skip to content

Commit e43afd1

Browse files
cvinayakgalak
authored andcommitted
Bluetooth: Controller: Fix free rx buffer MFIFO enqueue
Replace the post decrement in loop's conditional into explicit decrement inside the loop so as to avoid decrementing the maximum count without enqueueing free rx buffers into the free rx buffer MFIFO. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 6d9b318 commit e43afd1

File tree

1 file changed

+3
-1
lines changed
  • subsys/bluetooth/controller/ll_sw

1 file changed

+3
-1
lines changed

subsys/bluetooth/controller/ll_sw/ull.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1997,7 +1997,7 @@ static inline void rx_alloc(uint8_t max)
19971997
max = mem_link_rx.quota_pdu;
19981998
}
19991999

2000-
while ((max--) && MFIFO_ENQUEUE_IDX_GET(pdu_rx_free, &idx)) {
2000+
while (max && MFIFO_ENQUEUE_IDX_GET(pdu_rx_free, &idx)) {
20012001
memq_link_t *link;
20022002
struct node_rx_hdr *rx;
20032003

@@ -2017,6 +2017,8 @@ static inline void rx_alloc(uint8_t max)
20172017
MFIFO_BY_IDX_ENQUEUE(pdu_rx_free, idx, rx);
20182018

20192019
ll_rx_link_inc_quota(-1);
2020+
2021+
max--;
20202022
}
20212023

20222024
#if defined(CONFIG_BT_CONN)

0 commit comments

Comments
 (0)