nimble/host: Fix ble_sm_tx called without a lock

This commit is contained in:
Simon Ratner
2019-02-25 12:42:10 +01:00
committed by Andrzej Kaczmarek
parent 92ab01ca9b
commit ff5d9a6211
+6 -1
View File
@@ -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