mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-09-26 02:37:22 +00:00
nimble/host: Fix ble_sm_tx called without a lock
This commit is contained in:
committed by
Andrzej Kaczmarek
parent
92ab01ca9b
commit
ff5d9a6211
@@ -2727,6 +2727,7 @@ ble_sm_rx(struct ble_l2cap_chan *chan)
|
||||
struct ble_sm_pair_fail *cmd;
|
||||
struct os_mbuf *txom;
|
||||
uint16_t handle;
|
||||
int rc;
|
||||
|
||||
handle = ble_l2cap_get_conn_handle(chan);
|
||||
if (!handle) {
|
||||
@@ -2740,7 +2741,11 @@ ble_sm_rx(struct ble_l2cap_chan *chan)
|
||||
|
||||
cmd->reason = BLE_SM_ERR_PAIR_NOT_SUPP;
|
||||
|
||||
return ble_sm_tx(handle, txom);
|
||||
ble_hs_lock();
|
||||
rc = ble_sm_tx(handle, txom);
|
||||
ble_hs_unlock();
|
||||
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user