summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorJohan Hedberg2014-08-17 22:28:57 +0200
committerMarcel Holtmann2014-09-08 19:07:53 +0200
commitf8aaf9b65a77267f749c1af641e46c3457d50701 (patch)
treede1e0c30c71feca081078fe6a23daa5703759d94 /net/bluetooth/hci_core.c
parentBluetooth: Improve *_get() functions to return the object type (diff)
downloadkernel-qcow2-linux-f8aaf9b65a77267f749c1af641e46c3457d50701.tar.gz
kernel-qcow2-linux-f8aaf9b65a77267f749c1af641e46c3457d50701.tar.xz
kernel-qcow2-linux-f8aaf9b65a77267f749c1af641e46c3457d50701.zip
Bluetooth: Fix using hci_conn_get() for hci_conn pointers
Wherever we keep hci_conn pointers around we should be using hci_conn_get/put to ensure that they stay valid. This patch fixes all places violating against the principle currently. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 9b7145959a49..ed60d37ea646 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2541,6 +2541,7 @@ static void hci_pend_le_actions_clear(struct hci_dev *hdev)
list_for_each_entry(p, &hdev->le_conn_params, list) {
if (p->conn) {
hci_conn_drop(p->conn);
+ hci_conn_put(p->conn);
p->conn = NULL;
}
list_del_init(&p->action);
@@ -3734,8 +3735,10 @@ void hci_conn_params_del(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type)
if (!params)
return;
- if (params->conn)
+ if (params->conn) {
hci_conn_drop(params->conn);
+ hci_conn_put(params->conn);
+ }
list_del(&params->action);
list_del(&params->list);
@@ -3767,8 +3770,10 @@ void hci_conn_params_clear_all(struct hci_dev *hdev)
struct hci_conn_params *params, *tmp;
list_for_each_entry_safe(params, tmp, &hdev->le_conn_params, list) {
- if (params->conn)
+ if (params->conn) {
hci_conn_drop(params->conn);
+ hci_conn_put(params->conn);
+ }
list_del(&params->action);
list_del(&params->list);
kfree(params);