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
@@ -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;
}
