From 7894a9321df73851eb69203f6adef4c092f598c5 Mon Sep 17 00:00:00 2001 From: paul-szczepanek-arm <33840200+paul-szczepanek-arm@users.noreply.github.com> Date: Thu, 28 Mar 2019 15:20:46 +0000 Subject: [PATCH] fix releaseing the WSF msg too early --- .../targets/TARGET_CORDIO/stack_adaptation/hci_tr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack_adaptation/hci_tr.c b/features/FEATURE_BLE/targets/TARGET_CORDIO/stack_adaptation/hci_tr.c index ff300ddad9..a15d7de0bf 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack_adaptation/hci_tr.c +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/stack_adaptation/hci_tr.c @@ -66,11 +66,12 @@ void hciTrSendAclData(void *pContext, uint8_t *pData) HCI_PDUMP_TX_ACL(len, pData); /* transmit ACL header and data */ - if (hciDrvWrite(HCI_ACL_TYPE, len, pData) == len) + if (hciDrvWrite(HCI_ACL_TYPE, len, pData) != len) { - /* free buffer */ - hciCoreTxAclComplete(pContext, pData); + /* transport failure */ + WSF_ASSERT(0); } + /* pData is not freed as the hciDrvWrite took ownership of the WSF buffer */ }