summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/l2cap_core.c
diff options
context:
space:
mode:
authorVinicius Costa Gomes2011-08-20 02:06:51 +0200
committerGustavo F. Padovan2011-09-21 17:58:11 +0200
commitd26a23454813908a1bf0e2fd8c73233b22c6dbd7 (patch)
tree20a47fdba8e49371265684bc2ed2306d7c042195 /net/bluetooth/l2cap_core.c
parentBluetooth: Reset the security timer when a command is queued (diff)
downloadkernel-qcow2-linux-d26a23454813908a1bf0e2fd8c73233b22c6dbd7.tar.gz
kernel-qcow2-linux-d26a23454813908a1bf0e2fd8c73233b22c6dbd7.tar.xz
kernel-qcow2-linux-d26a23454813908a1bf0e2fd8c73233b22c6dbd7.zip
Bluetooth: Add a flag to indicate that SMP is going on
Add HCI_CONN_LE_SMP_PEND flag to indicate that SMP is pending for that connection. This allows to have information that an SMP procedure is going on for that connection. We use the HCI_CONN_ENCRYPT_PEND to indicate that encryption (HCI_LE_Start_Encryption) is pending for that connection. While a SMP procedure is going on we hold an reference to the connection, to avoid disconnections. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/l2cap_core.c')
-rw-r--r--net/bluetooth/l2cap_core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index b3bdb482bbe6..8136752d824b 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -986,8 +986,10 @@ static void l2cap_conn_del(struct hci_conn *hcon, int err)
if (conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_SENT)
del_timer_sync(&conn->info_timer);
- if (test_bit(HCI_CONN_ENCRYPT_PEND, &hcon->pend))
+ if (test_and_clear_bit(HCI_CONN_LE_SMP_PEND, &hcon->pend)) {
del_timer(&conn->security_timer);
+ hci_conn_put(hcon);
+ }
hcon->l2cap_data = NULL;
kfree(conn);