From f18645d7967378132bae8c60d5e199326d5a96cc Mon Sep 17 00:00:00 2001 From: fabik111 Date: Tue, 29 Oct 2024 15:20:53 +0100 Subject: [PATCH] remove loop for error handling --- .../ble/FEATURE_BLE/COMPONENT_CYW43XXX/HCIDriver.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/HCIDriver.cpp b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/HCIDriver.cpp index ff389c9f815..8a52467db00 100644 --- a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/HCIDriver.cpp +++ b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/HCIDriver.cpp @@ -392,7 +392,7 @@ class HCIDriver : public CordioHCIDriver { { uint16_t cmd_len = service_pack_ptr[service_pack_index + 2]; uint16_t cmd_opcode = (service_pack_ptr[service_pack_index + 1] << 8) | service_pack_ptr[service_pack_index + 0]; - uint8_t *pBuf = hciCmdAlloc(cmd_opcode, cmd_len); + uint8_t *pBuf = hciCmdAlloc(cmd_opcode, cmd_len); if (pBuf) { memcpy(pBuf + HCI_CMD_HDR_LEN, service_pack_ptr + service_pack_index + HCI_CMD_HDR_LEN, cmd_len); inject_bdaddr(pBuf); @@ -407,9 +407,9 @@ class HCIDriver : public CordioHCIDriver { if (cmd_opcode != opcode) { // DO something in case of error - - while (true); - + + return; + } // update service pack index