From d3dc966fc7e962338745c8677f383b497dd745c1 Mon Sep 17 00:00:00 2001 From: Jakub Rotkiewicz Date: Mon, 26 Sep 2022 10:10:59 +0200 Subject: [PATCH] nimble/host: fix l2cap coc rx endpoint buffs alloc Dissallow current vs next sdu index check when only one buffer is used. --- nimble/host/src/ble_l2cap_coc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nimble/host/src/ble_l2cap_coc.c b/nimble/host/src/ble_l2cap_coc.c index 875dbeba0..c9d7b61be 100644 --- a/nimble/host/src/ble_l2cap_coc.c +++ b/nimble/host/src/ble_l2cap_coc.c @@ -604,7 +604,8 @@ ble_l2cap_coc_recv_ready(struct ble_l2cap_chan *chan, struct os_mbuf *sdu_rx) } if (chan->coc_rx.sdus[0] != NULL && - chan->coc_rx.next_sdu_alloc_idx == chan->coc_rx.current_sdu_idx) { + chan->coc_rx.next_sdu_alloc_idx == chan->coc_rx.current_sdu_idx && + BLE_L2CAP_SDU_BUFF_CNT != 1) { return BLE_HS_EBUSY; }