From 87481cfc8dd45074b56c6729b86447e14ed5dd1d Mon Sep 17 00:00:00 2001 From: Vishal Agarwal Date: Mon, 16 Apr 2012 14:44:44 +0530 Subject: [PATCH] --- yaml --- r: 299983 b: refs/heads/master c: 6ec5bcadc21e13ceba8c144e4731eccac01d04f7 h: refs/heads/master i: 299981: f582faf024abc8ea5a27ccf28b963fff269514bd 299979: d0e1604f08086e217c6cde59cff431566582bdc5 299975: 269a49bae6470aaeb042371a942b21fe663ebb76 299967: 692b1796e390ed4bc46e856142f84c6b88e912e8 v: v3 --- [refs] | 2 +- trunk/include/net/bluetooth/hci_core.h | 1 + trunk/net/bluetooth/hci_core.c | 6 ++---- trunk/net/bluetooth/hci_event.c | 2 ++ 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 838043f557d5..f4ad7f943b9d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 745c0ce35f904aeff8e1ea325c259a14a00ff1b7 +refs/heads/master: 6ec5bcadc21e13ceba8c144e4731eccac01d04f7 diff --git a/trunk/include/net/bluetooth/hci_core.h b/trunk/include/net/bluetooth/hci_core.h index f8577c16fcf5..db1c5df45224 100644 --- a/trunk/include/net/bluetooth/hci_core.h +++ b/trunk/include/net/bluetooth/hci_core.h @@ -314,6 +314,7 @@ struct hci_conn { __u8 remote_cap; __u8 remote_auth; + bool flush_key; unsigned int sent; diff --git a/trunk/net/bluetooth/hci_core.c b/trunk/net/bluetooth/hci_core.c index c2251e4c3b72..a7607e4be347 100644 --- a/trunk/net/bluetooth/hci_core.c +++ b/trunk/net/bluetooth/hci_core.c @@ -1330,10 +1330,8 @@ int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key, mgmt_new_link_key(hdev, key, persistent); - if (!persistent) { - list_del(&key->list); - kfree(key); - } + if (conn) + conn->flush_key = !persistent; return 0; } diff --git a/trunk/net/bluetooth/hci_event.c b/trunk/net/bluetooth/hci_event.c index badb7851d116..6a72eaea70ee 100644 --- a/trunk/net/bluetooth/hci_event.c +++ b/trunk/net/bluetooth/hci_event.c @@ -1902,6 +1902,8 @@ static inline void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff } if (ev->status == 0) { + if (conn->type == ACL_LINK && conn->flush_key) + hci_remove_link_key(hdev, &conn->dst); hci_proto_disconn_cfm(conn, ev->reason); hci_conn_del(conn); }