jrotkiewicz commented on code in PR #1271:
URL: https://github.com/apache/mynewt-nimble/pull/1271#discussion_r929781378


##########
nimble/host/src/ble_l2cap_coc.c:
##########
@@ -257,17 +265,19 @@ ble_l2cap_coc_rx_fn(struct ble_l2cap_chan *chan)
 
     rx->credits--;
 
-    if (OS_MBUF_PKTLEN(rx->sdu) == rx->data_offset) {
-        struct os_mbuf *sdu_rx = rx->sdu;
+    if (OS_MBUF_PKTLEN(rx_sdu) == rx->data_offset) {
+        struct os_mbuf *sdu_rx = rx_sdu;
 
         BLE_HS_LOG(DEBUG, "Received sdu_len=%d, credits left=%d\n",
-                   OS_MBUF_PKTLEN(rx->sdu), rx->credits);
+                   OS_MBUF_PKTLEN(rx_sdu), rx->credits);
 
         /* Lets get back control to os_mbuf to application.
          * Since it this callback application might want to set new sdu
          * we need to prepare space for this. Therefore we need sdu_rx
          */
-        rx->sdu = NULL;
+        rx_sdu = NULL;
+        current_sdu =
+            current_sdu < BLE_L2CAP_SDU_BUFF_CNT - 1 ? current_sdu + 1 : 0;

Review Comment:
   fixed



-- 
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: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to