From 5b9a89f04dec613989fa01ef74bd45e47c611c9e Mon Sep 17 00:00:00 2001 From: Yulong Date: Fri, 30 Jun 2017 04:27:11 -0400 Subject: [PATCH] component/bt: squech the commit component/bt: Fixed the bug crash of disconnet BLE when close the SMP module in the menuconfig. component/bt: Removed the Excess #endid ///SMP_INCLUDED == TRUE in the l2cu_no_dynamic_ccbs function. --- components/bt/bluedroid/stack/l2cap/l2c_utils.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/bt/bluedroid/stack/l2cap/l2c_utils.c b/components/bt/bluedroid/stack/l2cap/l2c_utils.c index 05067c389..f0f96dbed 100644 --- a/components/bt/bluedroid/stack/l2cap/l2c_utils.c +++ b/components/bt/bluedroid/stack/l2cap/l2c_utils.c @@ -2642,7 +2642,16 @@ void l2cu_no_dynamic_ccbs (tL2C_LCB *p_lcb) /* probably no buffer to send disconnect */ timeout = BT_1SEC_TIMEOUT; } +#else + if (btsnd_hcic_disconnect (p_lcb->handle, HCI_ERR_PEER_USER)) { + l2cu_process_fixed_disc_cback(p_lcb); + p_lcb->link_state = LST_DISCONNECTING; + timeout = L2CAP_LINK_DISCONNECT_TOUT; + } else { + timeout = BT_1SEC_TIMEOUT; + } #endif ///SMP_INCLUDED == TRUE + } if (timeout != 0xFFFF) {