You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2023/02/24 13:50:27 UTC
[mynewt-nimble] branch master updated: nimble/ll: Fix missing critical section exit in PAST
This is an automated email from the ASF dual-hosted git repository.
janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
The following commit(s) were added to refs/heads/master by this push:
new 9bed38f9 nimble/ll: Fix missing critical section exit in PAST
9bed38f9 is described below
commit 9bed38f91a6a658527a49058ac89a8783461fcae
Author: Szymon Janc <sz...@codecoup.pl>
AuthorDate: Wed Feb 22 11:55:22 2023 +0100
nimble/ll: Fix missing critical section exit in PAST
It was possible to exit ble_ll_sync_transfer() without exiting
critical section.
---
nimble/controller/src/ble_ll_sync.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/nimble/controller/src/ble_ll_sync.c b/nimble/controller/src/ble_ll_sync.c
index 971f8799..c83f4e31 100644
--- a/nimble/controller/src/ble_ll_sync.c
+++ b/nimble/controller/src/ble_ll_sync.c
@@ -2185,32 +2185,30 @@ ble_ll_sync_transfer(const uint8_t *cmdbuf, uint8_t len,
if (!(sm->flags & BLE_LL_SYNC_SM_FLAG_ESTABLISHED)) {
rc = BLE_ERR_UNK_ADV_INDENT;
- OS_EXIT_CRITICAL(sr);
- goto done;
+ goto exit_crit;
}
handle = le16toh(cmd->conn_handle);
if (handle > 0xeff) {
rc = BLE_ERR_INV_HCI_CMD_PARMS;
- OS_EXIT_CRITICAL(sr);
- goto done;
+ goto exit_crit;
}
connsm = ble_ll_conn_find_by_handle(handle);
if (!connsm) {
rc = BLE_ERR_UNK_CONN_ID;
- OS_EXIT_CRITICAL(sr);
- goto done;
+ goto exit_crit;
}
/* Allow initiate LL procedure only if remote supports it. */
if (!ble_ll_conn_rem_feature_check(connsm, BLE_LL_FEAT_SYNC_TRANS_RECV)) {
rc = BLE_ERR_UNSUPP_REM_FEATURE;
- goto done;
+ goto exit_crit;
}
rc = ble_ll_sync_send_sync_ind(sm, connsm, cmd->service_data);
+exit_crit:
OS_EXIT_CRITICAL(sr);
done:
rsp->conn_handle = cmd->conn_handle;