KKopyscinski commented on code in PR #1567:
URL: https://github.com/apache/mynewt-nimble/pull/1567#discussion_r1273399633
##########
nimble/host/src/ble_l2cap_coc.c:
##########
@@ -341,7 +341,8 @@ ble_l2cap_coc_chan_alloc(struct ble_hs_conn *conn, uint16_t
psm, uint16_t mtu,
chan->coc_rx.sdus[i] = NULL;
}
chan->coc_rx.current_sdu_idx = 0;
- chan->coc_rx.next_sdu_alloc_idx = chan->coc_rx.sdus[0] == NULL ? 0 : 1;
+ chan->coc_rx.next_sdu_alloc_idx = chan->coc_rx.sdus[0] == NULL ||
Review Comment:
`ble_l2cap_coc_chan_alloc` can be called with `*sdu_rx = NULL` - in that
case, with previous fix, we would set `next_sdu_alloc_idx = 1` where it should
be 0. Fixed this with simple if case for `BLE_L2CAP_SDU_BUFF_CNT == 1`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]