You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ry...@apache.org on 2020/04/17 12:56:55 UTC

[mynewt-nimble] 03/04: nimble/l2cap: Fix return error code

This is an automated email from the ASF dual-hosted git repository.

rymek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git

commit ee42c7979eae4f7444ec2678463961521c79fd8a
Author: Ɓukasz Rymanowski <lu...@codecoup.pl>
AuthorDate: Fri Sep 27 10:15:56 2019 +0200

    nimble/l2cap: Fix return error code
    
    os_mbuf_foo() returns OS_ERR codes and we want to return BLE_HS_ERR
    codes.
    This patch fixes it
---
 nimble/host/src/ble_l2cap_coc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/nimble/host/src/ble_l2cap_coc.c b/nimble/host/src/ble_l2cap_coc.c
index 54ea321..b15646f 100644
--- a/nimble/host/src/ble_l2cap_coc.c
+++ b/nimble/host/src/ble_l2cap_coc.c
@@ -440,6 +440,7 @@ ble_l2cap_coc_continue_tx(struct ble_l2cap_chan *chan)
             BLE_HS_LOG(DEBUG, "Sending SDU len=%d\n", OS_MBUF_PKTLEN(tx->sdu));
             rc = os_mbuf_append(txom, &l, sizeof(uint16_t));
             if (rc) {
+                rc = BLE_HS_ENOMEM;
                 BLE_HS_LOG(DEBUG, "Could not append data rc=%d", rc);
                 goto failed;
             }
@@ -452,6 +453,7 @@ ble_l2cap_coc_continue_tx(struct ble_l2cap_chan *chan)
         rc = os_mbuf_appendfrom(txom, tx->sdu, tx->data_offset,
                                 len - sdu_size_offset);
         if (rc) {
+            rc = BLE_HS_ENOMEM;
             BLE_HS_LOG(DEBUG, "Could not append data rc=%d", rc);
             goto failed;
         }